|
|
f1be0a |
commit c29123244e546986ff3c9e6fe94772c4411adf2b
|
|
|
f1be0a |
Author: Olav Morken <olav.morken@uninett.no>
|
|
|
f1be0a |
Date: Wed Aug 16 17:28:16 2017 +0200
|
|
|
f1be0a |
|
|
|
f1be0a |
Make MellonUser case-insensitive.
|
|
|
f1be0a |
|
|
|
f1be0a |
MellonUser used to perform its attribute match in a case-sesnsitive
|
|
|
f1be0a |
manner, while environment variables are stored in a case-insensitive
|
|
|
f1be0a |
table in Apache.
|
|
|
f1be0a |
|
|
|
f1be0a |
The result is a bit of inconsistency between the way mod_auth_mellon
|
|
|
f1be0a |
handles the attribute names and the way they are accessed other places
|
|
|
f1be0a |
in Apache.
|
|
|
f1be0a |
|
|
|
f1be0a |
This patch changes the code to use a case-insensitive match when
|
|
|
f1be0a |
processing the MellonUser directive.
|
|
|
f1be0a |
|
|
|
f1be0a |
Fixes issue #131.
|
|
|
f1be0a |
|
|
|
f1be0a |
diff --git a/auth_mellon_cache.c b/auth_mellon_cache.c
|
|
|
f1be0a |
index cd3b9b0..7d51589 100644
|
|
|
f1be0a |
--- a/auth_mellon_cache.c
|
|
|
f1be0a |
+++ b/auth_mellon_cache.c
|
|
|
f1be0a |
@@ -552,7 +552,7 @@ void am_cache_env_populate(request_rec *r, am_cache_entry_t *t)
|
|
|
f1be0a |
if (am_cache_entry_slot_is_empty(&t->user)) {
|
|
|
f1be0a |
for(i = 0; i < t->size; ++i) {
|
|
|
f1be0a |
varname = am_cache_entry_get_string(t, &t->env[i].varname);
|
|
|
f1be0a |
- if (strcmp(varname, d->userattr) == 0) {
|
|
|
f1be0a |
+ if (strcasecmp(varname, d->userattr) == 0) {
|
|
|
f1be0a |
value = am_cache_entry_get_string(t, &t->env[i].value);
|
|
|
f1be0a |
status = am_cache_entry_store_string(t, &t->user, value);
|
|
|
f1be0a |
if (status != 0) {
|
|
|
f1be0a |
@@ -592,7 +592,7 @@ void am_cache_env_populate(request_rec *r, am_cache_entry_t *t)
|
|
|
f1be0a |
* If we find a variable remapping to MellonUser, use it.
|
|
|
f1be0a |
*/
|
|
|
f1be0a |
if (am_cache_entry_slot_is_empty(&t->user) &&
|
|
|
f1be0a |
- (strcmp(varname, d->userattr) == 0)) {
|
|
|
f1be0a |
+ (strcasecmp(varname, d->userattr) == 0)) {
|
|
|
f1be0a |
status = am_cache_entry_store_string(t, &t->user, value);
|
|
|
f1be0a |
if (status != 0) {
|
|
|
f1be0a |
ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
|