head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.6 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.4 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.2 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.1.0.4 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.2 pkgsrc-2011Q2-base:1.1; locks; strict; comment @# @; 1.2 date 2011.12.06.09.58.01; author manu; state dead; branches; next 1.1; 1.1 date 2011.04.04.08.46.42; author manu; state Exp; branches; next ; desc @@ 1.2 log @Update to mod_auth_mellon 0.4.0 plus upstream patch: * Honour MellonProbeDiscoveryIdP order when sending probes * Allow MellonUser variable to be translated through MellonSetEnv * A /mellon/probeDisco endpoint replaces the builtin:get-metadata IdP dicovery URL scheme * New MellonCond directive to enable attribute filtering beyond MellonRequire functionalities. * New MellonIdPMetadataGlob directive to load mulitple IdP metadata using a glob(3) pattern. * Support for running behind reverse proxy. * MellonCookieDomain and MellonCookiePath options to configure cookie settings. * Support for loading federation metadata files. * Several bugfixes. @ text @$NetBSD: patch-af,v 1.1 2011/04/04 08:46:42 manu Exp $ Make remapped attribute usable for MellonUser --- auth_mellon_cache.c.orig 2011-02-28 17:12:42.000000000 +0100 +++ auth_mellon_cache.c 2011-02-28 17:59:02.000000000 +0100 @@@@ -367,21 +367,8 @@@@ } } } - if(t->user[0] != '\0') { - /* We have a user-"name". Set r->user and r->ap_auth_type. */ - r->user = apr_pstrdup(r->pool, t->user); - r->ap_auth_type = apr_pstrdup(r->pool, "Mellon"); - } else { - /* We don't have a user-"name". Log error. */ - ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r, - "Didn't find the attribute \"%s\" in the attributes" - " which were received from the IdP. Cannot set a user" - " for this request without a valid user attribute.", - d->userattr); - } - /* Allocate a set of counters for duplicate variables in the list. */ counters = apr_hash_make(r->pool); /* Populate the subprocess environment with the attributes we @@@@ -398,8 +385,13 @@@@ } value = t->env[i].value; + /* + * If we find a variable remapping to MellonUser, use it. + */ + if ((t->user[0] == '\0') && (strcmp(varname, d->userattr) == 0)) + strcpy(t->user, value); /* Find the number of times this variable has been set. */ count = apr_hash_get(counters, varname, APR_HASH_KEY_STRING); if(count == NULL) { @@@@ -425,8 +417,22 @@@@ /* Increase the count. */ ++(*count); } + if(t->user[0] != '\0') { + /* We have a user-"name". Set r->user and r->ap_auth_type. */ + r->user = apr_pstrdup(r->pool, t->user); + r->ap_auth_type = apr_pstrdup(r->pool, "Mellon"); + } else { + /* We don't have a user-"name". Log error. */ + ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r, + "Didn't find the attribute \"%s\" in the attributes" + " which were received from the IdP. Cannot set a user" + " for this request without a valid user attribute.", + d->userattr); + } + + /* Populate with the session? */ if (d->dump_session) { char *session; int srclen, dstlen; @ 1.1 log @Patches from upcoming 0.3.1 @ text @d1 1 a1 1 $NetBSD$ @