From the 2.2.x STATUS doc:
   * mod_authn_dbd: Export any additional columns queried in the SQL select
     into the environment with the name AUTHENTICATE_<COLUMN>. This brings
     mod_authn_dbd behaviour in line with mod_authnz_ldap.
     Trunk: http://svn.apache.org/viewvc?view=rev&revision=466865
     +1: minfrin
     niq: This wants a little tidying.  Use of 13 as a magic number (for a
          strlen of something defined elsewhere) is nasty.  More importantly
          you need to document how it affects the module's directives.
          I'll +1 it when that's done.
     wrowe: ditto's - good concept.

Here's a patch to eliminate the "13", and to improve portability to
EBCDIC machines by using apr_toupper().

  Martin
-- 
<[EMAIL PROTECTED]>        |     Fujitsu Siemens
http://www.fujitsu-siemens.com/imprint.html | 81730  Munich,  Germany
Index: modules/aaa/mod_authn_dbd.c
===================================================================
--- modules/aaa/mod_authn_dbd.c (Revision 571317)
+++ modules/aaa/mod_authn_dbd.c (Arbeitskopie)
@@ -138,7 +138,7 @@
                 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 @@
                 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: modules/aaa/mod_authnz_ldap.c
===================================================================
--- modules/aaa/mod_authnz_ldap.c       (Revision 571317)
+++ modules/aaa/mod_authnz_ldap.c       (Arbeitskopie)
@@ -442,11 +442,9 @@
         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]);

Attachment: pgpYtb4EVUr2M.pgp
Description: PGP signature

Reply via email to