Blame SOURCES/0003-am_check_permissions-env.-variable-mapping-fix.patch

70c9ed
From 718fd6a0420bcaff04a2f896e294ea2b7abc9680 Mon Sep 17 00:00:00 2001
70c9ed
From: Jarek Polok <jaroslaw.polok@cern.ch>
70c9ed
Date: Sun, 16 Nov 2014 11:04:04 +0100
70c9ed
Subject: [PATCH] am_check_permissions() env. variable mapping fix.
70c9ed
70c9ed
---
70c9ed
 auth_mellon_util.c | 14 +++++++++-----
70c9ed
 1 file changed, 9 insertions(+), 5 deletions(-)
70c9ed
70c9ed
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
70c9ed
index d3acc959eb35e6458b90a093056af026d8ab4854..4b7e657938a47326cf4881da645659228ba2b578 100644
70c9ed
--- a/auth_mellon_util.c
70c9ed
+++ b/auth_mellon_util.c
70c9ed
@@ -300,16 +300,20 @@ int am_check_permissions(request_rec *r, am_cache_entry_t *session)
70c9ed
          */
70c9ed
         for (j = 0; (j < session->size) && !match; j++) {
70c9ed
             const char *varname = NULL;
70c9ed
+            am_envattr_conf_t *envattr_conf = NULL;
70c9ed
 
70c9ed
             /*
70c9ed
              * if MAP flag is set, check for remapped 
70c9ed
              * attribute name with mellonSetEnv
70c9ed
              */
70c9ed
-            if (ce->flags & AM_COND_FLAG_MAP)
70c9ed
-                varname = apr_hash_get(dir_cfg->envattr, 
70c9ed
-                                       am_cache_entry_get_string(session,
70c9ed
-                                                    &session->env[j].varname),
70c9ed
-                                       APR_HASH_KEY_STRING);
70c9ed
+            if (ce->flags & AM_COND_FLAG_MAP) {
70c9ed
+                envattr_conf =  (am_envattr_conf_t *)apr_hash_get(dir_cfg->envattr, 
70c9ed
+                                         am_cache_entry_get_string(session,&session->env[j].varname),
70c9ed
+                                         APR_HASH_KEY_STRING);
70c9ed
+                                                    
70c9ed
+                if (envattr_conf != NULL)
70c9ed
+                    varname = envattr_conf->name;
70c9ed
+            }
70c9ed
 
70c9ed
             /*
70c9ed
              * Otherwise or if not found, use the attribute name
70c9ed
-- 
70c9ed
2.1.0
70c9ed