aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Hauer <ohauer@FreeBSD.org>2014-10-15 20:44:40 +0000
committerOlli Hauer <ohauer@FreeBSD.org>2014-10-15 20:44:40 +0000
commitcd1ae541b23626cc3317366dbe6731c09cae64c3 (patch)
tree205b990957823bed6bfe2c9c460d5e19ea3aefcb
parentfd8cb3fa5940650c016751ee1e9f88a6f85cad5f (diff)
downloadports-cd1ae541b23626cc3317366dbe6731c09cae64c3.tar.gz
ports-cd1ae541b23626cc3317366dbe6731c09cae64c3.zip
MFH: r370882
- fix build with apache24 - fix build with subversion 1.8.x PR: 193536 Submitted by: ohauer Approved by: Vick Khera (maintainer) Obtained from: https://bitbucket.org/atlassian/cwdapache/pull-request/18/added-apache-24-compatibility-and-fixed/diff [2] [1] fix shaped and tested by Vick Khera [2] based on Approved by: portmgr (mat)
Notes
Notes: svn path=/branches/2014Q4/; revision=370952
-rw-r--r--www/mod_authnz_crowd/Makefile15
-rw-r--r--www/mod_authnz_crowd/files/patch-configure.ac31
-rw-r--r--www/mod_authnz_crowd/files/patch-src__Makefile.am4
-rw-r--r--www/mod_authnz_crowd/files/patch-src__apache24_svn18193
-rw-r--r--www/mod_authnz_crowd/files/patch-src__svn__Makefile.am4
-rw-r--r--www/mod_authnz_crowd/pkg-descr2
6 files changed, 225 insertions, 24 deletions
diff --git a/www/mod_authnz_crowd/Makefile b/www/mod_authnz_crowd/Makefile
index 37d2e1559581..ca777eb656a0 100644
--- a/www/mod_authnz_crowd/Makefile
+++ b/www/mod_authnz_crowd/Makefile
@@ -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,19 +22,26 @@ LIBS+= -L${LOCALBASE}/lib
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:
${REINPLACE_CMD} -e 's|@APXS_STAGE@|-S LIBEXECDIR=${STAGEDIR}${PREFIX}/${APACHEMODDIR}|' \
${WRKSRC}/src/Makefile.am
+ ${REINPLACE_CMD} -e 's|%%APACHEETCDIR%%|${APACHEETCDIR}|g' \
+ -e 's|%%APACHEINCLUDEDIR%%|${APACHEINCLUDEDIR}|g' \
+ -e 's|%%APACHEMODDIR%%|${APACHEMODDIR}|g' \
+ ${WRKSRC}/configure.ac
pre-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}
diff --git a/www/mod_authnz_crowd/files/patch-configure.ac b/www/mod_authnz_crowd/files/patch-configure.ac
index 786ddc1191a8..cb1e0cf83f37 100644
--- a/www/mod_authnz_crowd/files/patch-configure.ac
+++ b/www/mod_authnz_crowd/files/patch-configure.ac
@@ -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 05:20:50 UTC
++++ configure.ac
@@ -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/local/%%APACHEINCLUDEDIR%%/httpd.h], [APACHE_INCLUDE_DIR="/usr/local/%%APACHEINCLUDEDIR%%"], [
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,25 +26,25 @@
APACHE_BIN_DIR=`AS_DIRNAME($HTTPD)`
AC_SUBST([APACHE_BIN_DIR])
-@@ -32,7 +33,7 @@
+@@ -36,7 +37,7 @@
])
AC_SUBST([SVN_DIR])
-AC_CHECK_FILE([/usr/libexec/apache2/mod_dav.so], [APACHE_MODULES_DIR="/usr/libexec/apache2"], [
-+AC_CHECK_FILE([/usr/local/libexec/apache22/mod_dav.so], [APACHE_MODULES_DIR="/usr/local/libexec/apache22"], [
++AC_CHECK_FILE([/usr/local/%%APACHEMODDIR%%/mod_dav.so], [APACHE_MODULES_DIR="/usr/local/%%APACHEMODDIR%%"], [
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])
-AC_CHECK_FILE([/usr/local/apache2/conf/httpd.conf], [HTTPD_CONF="/usr/local/apache2/conf/httpd.conf"], [
-+AC_CHECK_FILE([/usr/local/etc/apache22/httpd.conf], [HTTPD_CONF="/usr/local/etc/apache22/httpd.conf"], [
++AC_CHECK_FILE([/usr/local/%%APACHEETCDIR%%/httpd.conf], [HTTPD_CONF="/usr/local/%%APACHEETCDIR%%/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 --git a/www/mod_authnz_crowd/files/patch-src__Makefile.am b/www/mod_authnz_crowd/files/patch-src__Makefile.am
index 8987f3df2307..6e90713b429f 100644
--- a/www/mod_authnz_crowd/files/patch-src__Makefile.am
+++ b/www/mod_authnz_crowd/files/patch-src__Makefile.am
@@ -1,5 +1,5 @@
---- src/Makefile.am-dist 2013-09-25 02:41:53.000000000 -0400
-+++ src/Makefile.am 2014-01-14 11:20:54.178664699 -0500
+--- src/Makefile.am.orig 2013-09-25 06:41:53 UTC
++++ src/Makefile.am
@@ -3,9 +3,9 @@
lib_LTLIBRARIES = mod_authnz_crowd.la
mod_authnz_crowd_la_SOURCES = mod_authnz_crowd.c mod_authnz_crowd.h crowd_client.c crowd_client.h cache.c cache.h util.c util.h
diff --git a/www/mod_authnz_crowd/files/patch-src__apache24_svn18 b/www/mod_authnz_crowd/files/patch-src__apache24_svn18
new file mode 100644
index 000000000000..9b7668a0bc6b
--- /dev/null
+++ b/www/mod_authnz_crowd/files/patch-src__apache24_svn18
@@ -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 --git a/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am b/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am
index 97f4f4d072b7..1aab5b1e1750 100644
--- a/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am
+++ b/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am
@@ -1,5 +1,5 @@
---- ./src/svn/Makefile.am.orig 2011-03-29 07:51:32.000000000 +0200
-+++ ./src/svn/Makefile.am 2013-06-22 22:54:04.000000000 +0200
+--- src/svn/Makefile.am.orig 2013-07-26 05:20:50 UTC
++++ src/svn/Makefile.am
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = mod_authz_svn_crowd.la
mod_authz_svn_crowd_la_SOURCES = mod_authz_svn_crowd.c
diff --git a/www/mod_authnz_crowd/pkg-descr b/www/mod_authnz_crowd/pkg-descr
index 1bef7459f328..67b9129c5b83 100644
--- a/www/mod_authnz_crowd/pkg-descr
+++ b/www/mod_authnz_crowd/pkg-descr
@@ -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