httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject [Fwd: Re: svn commit: r466865 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_authn_dbd.xml modules/aaa/mod_auth.h modules/aaa/mod_authn_dbd.c modules/aaa/mod_authnz_ldap.c]
Date Sat, 28 Oct 2006 10:00:51 GMT

On 10/22/2006 09:11 PM, wrote:
> Author: minfrin
> Date: Sun Oct 22 12:11:51 2006
> New Revision: 466865
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=466865
> Log:
> 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.
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/docs/manual/mod/mod_authn_dbd.xml
>     httpd/httpd/trunk/modules/aaa/mod_auth.h
>     httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c
>     httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c
> 
> 

> Modified: httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c?view=diff&rev=466865&r1=466864&r2=466865
> ==============================================================================
> --- httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c (original)
> +++ httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c Sun Oct 22 12:11:51 2006
> @@ -18,11 +18,13 @@

> @@ -126,6 +128,33 @@
>          }
>          if (dbd_password == NULL) {
>              dbd_password = apr_dbd_get_entry(dbd->driver, row, 0);
> +
> +#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION
>= 3)
> +            /* add the rest of the columns to the environment */
> +            int i = 1;
> +            const char *name;
> +            for (name = apr_dbd_get_name(dbd->driver, res, i);
> +                 name != NULL;
> +                 name = apr_dbd_get_name(dbd->driver, res, i)) {
> +
> +                char *str = apr_pstrcat(r->pool, AUTHN_PREFIX,
> +                                        name,
> +                                        NULL);
> +                int j = 13;

I would prefer strlen(AUTHN_PREFIX) instead of 13 here.

> +                while (str[j]) {
> +                    if (!apr_isalnum(str[j])) {
> +                        str[j] = '_';
> +                    }
> +                    else {
> +                        str[j] = apr_toupper(str[j]);
> +                    }
> +                    j++;
> +                }
> +                apr_table_setn(r->subprocess_env, str,
> +                               apr_dbd_get_entry(dbd->driver, row, i));
> +                i++;
> +            }
> +#endif
>          }
>          /* we can't break out here or row won't get cleaned up */
>      }

> @@ -184,6 +213,33 @@
>          }
>          if (dbd_hash == NULL) {
>              dbd_hash = apr_dbd_get_entry(dbd->driver, row, 0);
> +
> +#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION
>= 3)
> +            /* add the rest of the columns to the environment */
> +            int i = 1;
> +            const char *name;
> +            for (name = apr_dbd_get_name(dbd->driver, res, i);
> +                 name != NULL;
> +                 name = apr_dbd_get_name(dbd->driver, res, i)) {
> +
> +                char *str = apr_pstrcat(r->pool, AUTHN_PREFIX,
> +                                        name,

Does it really make sense to put this in the same environment namespace?
What if we have rows with the same name here and for the password query?
Shouldn't the prefix be AUTHN_PREFIX + (USER_|PASSWORD_)?

> +                                        NULL);
> +                int j = 13;

see above

Regards

RĂ¼diger


Mime
View raw message