]> granicus.if.org Git - apache/commitdiff
mod_authnz_ldap, mod_authn_dbd: Tidy up the code to expose authn parameters to the...
authorGraham Leggett <minfrin@apache.org>
Sat, 1 Sep 2007 13:26:27 +0000 (13:26 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 1 Sep 2007 13:26:27 +0000 (13:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@571798 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/aaa/mod_authn_dbd.c
modules/aaa/mod_authnz_ldap.c

diff --git a/CHANGES b/CHANGES
index 3c0a50ae0ab09f8b9671649bf5367438be9762a3..b6ddfb499b4bd5a66a71ee0dc3e7fe749d4ed89f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_authnz_ldap, mod_authn_dbd: Tidy up the code to expose authn
+     parameters to the environment. Improve portability to
+     EBCDIC machines by using apr_toupper(). [Martin Kraemer]
+
   *) mod_deflate: fix content_encoding detection in inflate_out filter
      when it's not in response headers table.
      PR 42993 [Nick Kew]
index d557c6b43bdb6c7fbe6988abafbf3bd9351723b2..c81e3111852a5dbb5f4f1cf4685a82631d22036b 100644 (file)
@@ -138,7 +138,7 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
                 char *str = apr_pstrcat(r->pool, AUTHN_PREFIX,
                                         name,
                                         NULL);
-                int j = 13;
+                int j = sizeof(AUTHN_PREFIX)-1; /* string length of "AUTHENTICATE_", excluding the trailing NIL */
                 while (str[j]) {
                     if (!apr_isalnum(str[j])) {
                         str[j] = '_';
@@ -222,7 +222,7 @@ static authn_status authn_dbd_realm(request_rec *r, const char *user,
                 char *str = apr_pstrcat(r->pool, AUTHN_PREFIX,
                                         name,
                                         NULL);
-                int j = 13;
+                int j = sizeof(AUTHN_PREFIX)-1; /* string length of "AUTHENTICATE_", excluding the trailing NIL */
                 while (str[j]) {
                     if (!apr_isalnum(str[j])) {
                         str[j] = '_';
index 406928dd3b46ac2dc5c19f68b78fbb4e69618501..3208b7fcafcf73dbdafc56f49dca80b2a38d8311 100644 (file)
@@ -30,6 +30,7 @@
 #include "apr_xlate.h"
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
+#include "apr_lib.h"
 
 #if APR_HAVE_UNISTD_H
 /* for getpid() */
@@ -442,11 +443,9 @@ start_over:
         int i = 0;
         while (sec->attributes[i]) {
             char *str = apr_pstrcat(r->pool, AUTHN_PREFIX, sec->attributes[i], NULL);
-            int j = 13;
+            int j = sizeof(AUTHN_PREFIX)-1; /* string length of "AUTHENTICATE_", excluding the trailing NIL */
             while (str[j]) {
-                if (str[j] >= 'a' && str[j] <= 'z') {
-                    str[j] = str[j] - ('a' - 'A');
-                }
+                str[j] = apr_toupper(str[j]);
                 j++;
             }
             apr_table_setn(e, str, vals[i]);