FreeBSD Bugzilla – Attachment 148301 Details for
Bug 193536
[patch] www/mod_authnz_crowd build against apache22/24
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proper patch to build against apache 2.4 and svn 1.8
crowd_port.patch (text/plain), 11.84 KB, created by
Vick Khera
on 2014-10-14 15:16:23 UTC
(
hide
)
Description:
proper patch to build against apache 2.4 and svn 1.8
Filename:
MIME Type:
Creator:
Vick Khera
Created:
2014-10-14 15:16:23 UTC
Size:
11.84 KB
patch
obsolete
>diff -Nru mod_authnz_crowd/Makefile mod_authnz_crowd.new/Makefile >--- mod_authnz_crowd/Makefile 2014-10-14 09:19:06.846515298 -0400 >+++ mod_authnz_crowd.new/Makefile 2014-10-14 11:05:36.453075294 -0400 >@@ -3,13 +3,13 @@ > > PORTNAME= mod_authnz_crowd > PORTVERSION= 2.2.2 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= www > MASTER_SITES= http://downloads.atlassian.com/software/crowd/downloads/cwdapache/ > DIST_SUBDIR= apache2 > > MAINTAINER= vivek@khera.org >-COMMENT= Apache 2.2.x module to use Atlassian Crowd for authentication >+COMMENT= Apache 2.2+ module to use Atlassian Crowd for authentication > > LICENSE= APACHE20 > >@@ -22,14 +22,17 @@ > USES= autoreconf libtool > USE_GNOME= libxml2 > USE_GCC= any >-USE_APACHE= 22 >+USE_APACHE= 22+ > > SUB_FILES= pkg-message zzz_authnz_crowd.conf > SUB_LIST+= APACHEETCDIR=${APACHEETCDIR} \ >- APACHEMODDIR=${APACHEMODDIR} >+ APACHEMODDIR=${APACHEMODDIR} \ >+ AP_MODULE=mod_authnz_crowd > > PLIST_FILES= ${APACHEMODDIR}/mod_authnz_crowd.so \ >+ ${APACHEMODDIR}/mod_authnz_crowd.so.0.0.0 \ > ${APACHEMODDIR}/mod_authz_svn_crowd.so \ >+ ${APACHEMODDIR}/mod_authz_svn_crowd.so.0.0.0 \ > ${APACHEETCDIR}/Includes/zzz_authnz_crowd.conf > > post-patch: >diff -Nru mod_authnz_crowd/files/patch-configure.ac mod_authnz_crowd.new/files/patch-configure.ac >--- mod_authnz_crowd/files/patch-configure.ac 2013-08-18 17:15:26.000000000 -0400 >+++ mod_authnz_crowd.new/files/patch-configure.ac 2014-10-14 10:49:49.518140207 -0400 >@@ -1,22 +1,23 @@ >---- ./configure.ac.orig 2011-03-29 07:51:33.000000000 +0200 >-+++ ./configure.ac 2013-06-22 22:54:04.000000000 +0200 >+--- configure.ac.orig 2013-07-26 01:20:50.000000000 -0400 >++++ configure.ac 2014-10-14 10:48:21.000000000 -0400 > @@ -1,5 +1,6 @@ >- AC_INIT([mod_authnz_crowd], [2.0.2], [support@atlassian.com]) >- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) >+ AC_INIT([mod_authnz_crowd], m4_esyscmd([./version-gen]), [support@atlassian.com]) >+-AM_INIT_AUTOMAKE([-Wall -Werror foreign]) >++AM_INIT_AUTOMAKE([-Wall foreign]) > +AM_PROG_AR > AC_PROG_CC > AC_PROG_LIBTOOL > AC_CONFIG_HEADERS([config.h]) >-@@ -12,7 +13,7 @@ >+@@ -16,7 +17,7 @@ > >- AC_CHECK_LIB([apr-1], [apr_pool_pre_cleanup_register], [], [AC_MSG_ERROR([apr_pool_pre_cleanup_register was not found in libapr-1])]) >+ AC_CHECK_LIB([xml2], [xmlFree], [CFLAGS+=" `xml2-config --cflags`" LIBS+=" `xml2-config --libs`"], [AC_MSG_ERROR([libxml2 was not found])]) > > -AC_CHECK_FILE([/usr/local/apache2/include/httpd.h], [APACHE_INCLUDE_DIR="/usr/local/apache2/include"], [ > +AC_CHECK_FILE([/usr/local/include/apache22/httpd.h], [APACHE_INCLUDE_DIR="/usr/local/include/apache22"], [ > AC_CHECK_FILE([/usr/include/httpd/httpd.h], [APACHE_INCLUDE_DIR="/usr/include/httpd"], [ > AC_CHECK_FILE([/usr/include/apache2/httpd.h], [APACHE_INCLUDE_DIR="/usr/include/apache2"], [ > AC_MSG_ERROR([Could not locate Apache include directory]) >-@@ -21,7 +22,7 @@ >+@@ -25,7 +26,7 @@ > ]) > AC_SUBST([APACHE_INCLUDE_DIR]) > >@@ -25,7 +26,7 @@ > APACHE_BIN_DIR=`AS_DIRNAME($HTTPD)` > AC_SUBST([APACHE_BIN_DIR]) > >-@@ -32,7 +33,7 @@ >+@@ -36,7 +37,7 @@ > ]) > AC_SUBST([SVN_DIR]) > >@@ -34,7 +35,7 @@ > AC_CHECK_FILE([/usr/lib64/httpd/modules/mod_dav.so], [APACHE_MODULES_DIR="/usr/lib64/httpd/modules"], [ > AC_CHECK_FILE([/usr/lib/httpd/modules/mod_dav.so], [APACHE_MODULES_DIR="/usr/lib/httpd/modules"], [ > AC_CHECK_FILE([/usr/lib/apache2/modules/mod_dav.so], [APACHE_MODULES_DIR="/usr/lib/apache2/modules"], [ >-@@ -43,7 +44,7 @@ >+@@ -47,7 +48,7 @@ > ]) > AC_SUBST([APACHE_MODULES_DIR]) > >@@ -42,8 +43,8 @@ > +AC_CHECK_FILE([/usr/local/etc/apache22/httpd.conf], [HTTPD_CONF="/usr/local/etc/apache22/httpd.conf"], [ > AC_CHECK_FILE([/etc/httpd/conf/httpd.conf], [HTTPD_CONF="/etc/httpd/conf/httpd.conf"], [ > AC_CHECK_FILE([/etc/apache2/httpd.conf], [HTTPD_CONF="/etc/apache2/httpd.conf"], [ >- AC_MSG_ERROR([Could not locate Apache configuration file]) >-@@ -52,7 +53,7 @@ >+ AC_CHECK_FILE([/etc/apache2/apache2.conf], [HTTPD_CONF="/etc/apache2/apache2.conf"], [ >+@@ -58,7 +59,7 @@ > ]) > AC_SUBST([HTTPD_CONF]) > >@@ -52,7 +53,7 @@ > AC_CHECK_FILE([/usr/sbin/apxs], [APXS="/usr/sbin/apxs"], [ > AC_CHECK_FILE([/usr/bin/apxs2], [APXS="/usr/bin/apxs2"], [ > AC_MSG_ERROR([Could not locate Apache apxs binary]) >-@@ -61,7 +62,7 @@ >+@@ -67,7 +68,7 @@ > ]) > AC_SUBST([APXS]) > >diff -Nru mod_authnz_crowd/files/patch-src__apache24_svn18 mod_authnz_crowd.new/files/patch-src__apache24_svn18 >--- mod_authnz_crowd/files/patch-src__apache24_svn18 1969-12-31 19:00:00.000000000 -0500 >+++ mod_authnz_crowd.new/files/patch-src__apache24_svn18 2014-10-14 10:55:37.551121381 -0400 >@@ -0,0 +1,193 @@ >+diff --git a/src/crowd_client.c b/src/crowd_client.c >+index c190d0b..9a42acf 100644 >+--- a/src/crowd_client.c >++++ src/crowd_client.c >+@@ -631,9 +631,15 @@ static char *make_app_cache_key(const request_rec *r, const crowd_config *config >+ } >+ >+ static char *make_session_cache_key(const char *token, const char *forwarded_for, const request_rec *r, const crowd_config *config) { >++#if AP_MODULE_MAGIC_AT_LEAST(20080403,1) >++ return log_ralloc(r, apr_psprintf(r->pool, "%s\037%s\037%s\037%s\037%s", token, >++ forwarded_for == NULL ? "" : forwarded_for, r->connection->client_ip, config->crowd_app_name, >++ config->crowd_url)); >++#else >+ return log_ralloc(r, apr_psprintf(r->pool, "%s\037%s\037%s\037%s\037%s", token, >+ forwarded_for == NULL ? "" : forwarded_for, r->connection->remote_ip, config->crowd_app_name, >+ config->crowd_url)); >++#endif >+ } >+ >+ /*========================== >+@@ -764,9 +770,15 @@ static bool handle_crowd_create_session_session_element(write_data_t *write_data >+ } >+ >+ static const char *get_validation_factors(const request_rec *r, const char *forwarded_for) { >++#if AP_MODULE_MAGIC_AT_LEAST(20080403,1) >++ const char *payload_beginning = log_ralloc(r, apr_pstrcat(r->pool, >++ "<validation-factors><validation-factor><name>remote_address</name><value>", r->connection->client_ip, >++ "</value></validation-factor>", NULL)); >++#else >+ const char *payload_beginning = log_ralloc(r, apr_pstrcat(r->pool, >+ "<validation-factors><validation-factor><name>remote_address</name><value>", r->connection->remote_ip, >+ "</value></validation-factor>", NULL)); >++#endif >+ if (payload_beginning == NULL) { >+ return NULL; >+ } >+@@ -863,7 +875,7 @@ static const char *make_validate_session_url(const request_rec *r, const crowd_c >+ >+ char *url = log_ralloc(r, apr_pstrcat(r->pool, urlWithoutToken, escapedToken, NULL)); >+ >+- curl_free(escapedToken); >++ curl_free((void *)escapedToken); >+ >+ return url; >+ } >+diff --git a/src/mod_authnz_crowd.c b/src/mod_authnz_crowd.c >+index 44232a2..e9f849b 100644 >+--- a/src/mod_authnz_crowd.c >++++ src/mod_authnz_crowd.c >+@@ -520,7 +520,6 @@ static authn_status authn_crowd_check_password(request_rec *r, const char *user, >+ static const authn_provider authn_crowd_provider = >+ { >+ &authn_crowd_check_password, /* Callback for HTTP Basic authentication */ >+- NULL /* Callback for HTTP Digest authentication */ >+ }; >+ >+ static unsigned int parse_number(const char *string, const char *name, unsigned int min, unsigned int max, >+@@ -611,6 +610,83 @@ apr_array_header_t *authnz_crowd_user_groups(const char *username, request_rec * >+ * @param r the current request >+ * @return OK, DECLINED, or HTTP_... >+ */ >++#if AP_MODULE_MAGIC_AT_LEAST(20080403,1) >++static authz_status auth_group_checker(request_rec *r, >++ const char *require_line, >++ const void *parsed_require_args) { >++ const char *t, *w; >++ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "mod_authnz_crowd:auth_group_checker"); >++ >++ authnz_crowd_dir_config *config = get_config(r); >++ if (config == NULL) { >++ return AUTHZ_GENERAL_ERROR; >++ } >++ >++ if (r->user == NULL) { >++ ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r, "Authorisation requested, but no user provided."); >++ return AUTHZ_DENIED_NO_USER; >++ } >++ >++ apr_array_header_t *user_groups = NULL; >++ >++ /* Fetch groups only if actually needed. */ >++ if (user_groups == NULL) { >++ user_groups = crowd_user_groups(r->user, r, config->crowd_config); >++ if (user_groups == NULL) { >++ return AUTHZ_GENERAL_ERROR; >++ } >++ } >++ >++ /* Iterate over the groups mentioned in the requirement. */ >++ t = require_line; >++ while ((w = ap_getword_conf(r->pool, &t)) && w[0]) { >++ int y; >++ for (y = 0; y < user_groups->nelts; y++) { >++ const char *user_group = APR_ARRAY_IDX(user_groups, y, const char *); >++ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, >++ "auth_group_checker: user_group=%s, required_group=%s", user_group, w); >++ if (strcasecmp(user_group, w) == 0) { >++ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, >++ "Granted authorisation to '%s' on the basis of membership of '%s'.", r->user, user_group); >++ return AUTHZ_GRANTED; >++ } >++ } >++ >++ } >++ >++ >++ ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r, "Denied authorisation to '%s'.", r->user); >++ return AUTHZ_DENIED; >++} >++ >++static const authz_provider authz_crowd_group_provider = >++{ >++ &auth_group_checker, >++ NULL, >++}; >++ >++static void register_hooks(apr_pool_t *p) >++{ >++ ap_hook_post_config(post_config, NULL, NULL, APR_HOOK_MIDDLE); >++ ap_hook_check_user_id(check_user_id, NULL, NULL, APR_HOOK_FIRST); >++ ap_register_auth_provider( >++ p, >++ AUTHN_PROVIDER_GROUP, >++ "crowd", >++ AUTHN_PROVIDER_VERSION, >++ &authn_crowd_provider, AP_AUTH_INTERNAL_PER_CONF >++ ); >++ >++ // Require crowd-group group1 group2 ... >++ ap_register_auth_provider( >++ p, >++ AUTHZ_PROVIDER_GROUP, >++ "crowd-group", >++ AUTHZ_PROVIDER_VERSION, >++ &authz_crowd_group_provider, AP_AUTH_INTERNAL_PER_CONF >++ ); >++} >++#else >+ static int auth_checker(request_rec *r) { >+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "mod_authnz_crowd:auth_checker"); >+ >+@@ -690,6 +766,9 @@ static void register_hooks(apr_pool_t *p) >+ ap_hook_auth_checker(auth_checker, pre_auth_checker, NULL, APR_HOOK_MIDDLE); >+ } >+ >++#endif >++ >++ >+ module AP_MODULE_DECLARE_DATA authnz_crowd_module = >+ { >+ STANDARD20_MODULE_STUFF, >+diff --git a/src/svn/mod_authz_svn_crowd.c b/src/svn/mod_authz_svn_crowd.c >+index 69b9aa0..3164a40 100644 >+--- a/src/svn/mod_authz_svn_crowd.c >++++ src/svn/mod_authz_svn_crowd.c >+@@ -50,6 +50,7 @@ >+ >+ #include <svn_pools.h> >+ #include <svn_dirent_uri.h> >++#include <svn_version.h> >+ >+ const char * >+ svn_fspath__canonicalize(const char *fspath, >+@@ -73,6 +74,7 @@ typedef struct authz_svn_config_rec { >+ const char *base_path; >+ const char *access_file; >+ const char *repo_relative_access_file; >++ const char *groups_file; // rwb >+ const char *force_username_case; >+ } authz_svn_config_rec; >+ >+@@ -105,6 +107,12 @@ struct svn_config_t >+ /* Temporary value used for expanded default values in svn_config_get. >+ (Using a stringbuf so that frequent resetting is efficient.) */ >+ svn_stringbuf_t *tmp_value; >++ >++#if SVN_VER_MINOR >= 7 >++ /* Specifies whether section names are populated case sensitively. */ >++ svn_boolean_t section_names_case_sensitive; >++#endif >++ >+ }; >+ >+ typedef struct >+@@ -113,7 +121,7 @@ typedef struct >+ const char *name; >+ >+ /* The section name, converted into a hash key. */ >+- const char *hash_key; >++ // const char *hash_key; >+ >+ /* Table of cfg_option_t's. */ >+ apr_hash_t *options; >diff -Nru mod_authnz_crowd/pkg-descr mod_authnz_crowd.new/pkg-descr >--- mod_authnz_crowd/pkg-descr 2013-08-18 17:15:26.000000000 -0400 >+++ mod_authnz_crowd.new/pkg-descr 2014-10-14 11:05:02.654310537 -0400 >@@ -1,4 +1,4 @@ >-Apache 2.2 connector for Atlassian Crowd to provide authentication and >+Apache 2.2/2.4 connector for Atlassian Crowd to provide authentication and > authorization support using Basic Auth. > > WWW: https://confluence.atlassian.com/display/CROWD/Integrating+Crowd+with+Apache
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193536
:
147185
| 148301