From owner-svn-ports-all@FreeBSD.ORG Tue Oct 14 20:13:32 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42B10744; Tue, 14 Oct 2014 20:13:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C958F63; Tue, 14 Oct 2014 20:13:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9EKDWGH034705; Tue, 14 Oct 2014 20:13:32 GMT (envelope-from ohauer@FreeBSD.org) Received: (from ohauer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9EKDUYv034696; Tue, 14 Oct 2014 20:13:30 GMT (envelope-from ohauer@FreeBSD.org) Message-Id: <201410142013.s9EKDUYv034696@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ohauer set sender to ohauer@FreeBSD.org using -f From: Olli Hauer Date: Tue, 14 Oct 2014 20:13:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r370882 - in head/www/mod_authnz_crowd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 20:13:32 -0000 Author: ohauer Date: Tue Oct 14 20:13:30 2014 New Revision: 370882 URL: https://svnweb.freebsd.org/changeset/ports/370882 QAT: https://qat.redports.org/buildarchive/r370882/ Log: - 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] MFH: 2014Q3 [1] fix shaped and tested by Vick Khera [2] based on Added: head/www/mod_authnz_crowd/files/patch-src__apache24_svn18 (contents, props changed) Modified: head/www/mod_authnz_crowd/Makefile head/www/mod_authnz_crowd/files/patch-configure.ac head/www/mod_authnz_crowd/files/patch-src__Makefile.am head/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am head/www/mod_authnz_crowd/pkg-descr Modified: head/www/mod_authnz_crowd/Makefile ============================================================================== --- head/www/mod_authnz_crowd/Makefile Tue Oct 14 19:18:47 2014 (r370881) +++ head/www/mod_authnz_crowd/Makefile Tue Oct 14 20:13:30 2014 (r370882) @@ -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} Modified: head/www/mod_authnz_crowd/files/patch-configure.ac ============================================================================== --- head/www/mod_authnz_crowd/files/patch-configure.ac Tue Oct 14 19:18:47 2014 (r370881) +++ head/www/mod_authnz_crowd/files/patch-configure.ac Tue Oct 14 20:13:30 2014 (r370882) @@ -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]) Modified: head/www/mod_authnz_crowd/files/patch-src__Makefile.am ============================================================================== --- head/www/mod_authnz_crowd/files/patch-src__Makefile.am Tue Oct 14 19:18:47 2014 (r370881) +++ head/www/mod_authnz_crowd/files/patch-src__Makefile.am Tue Oct 14 20:13:30 2014 (r370882) @@ -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 Added: head/www/mod_authnz_crowd/files/patch-src__apache24_svn18 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/mod_authnz_crowd/files/patch-src__apache24_svn18 Tue Oct 14 20:13:30 2014 (r370882) @@ -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, ++ "remote_address", r->connection->client_ip, ++ "", NULL)); ++#else + const char *payload_beginning = log_ralloc(r, apr_pstrcat(r->pool, + "remote_address", r->connection->remote_ip, + "", 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 + #include ++#include + + 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; Modified: head/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am ============================================================================== --- head/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am Tue Oct 14 19:18:47 2014 (r370881) +++ head/www/mod_authnz_crowd/files/patch-src__svn__Makefile.am Tue Oct 14 20:13:30 2014 (r370882) @@ -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 Modified: head/www/mod_authnz_crowd/pkg-descr ============================================================================== --- head/www/mod_authnz_crowd/pkg-descr Tue Oct 14 19:18:47 2014 (r370881) +++ head/www/mod_authnz_crowd/pkg-descr Tue Oct 14 20:13:30 2014 (r370882) @@ -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