httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r425740 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/aaa/mod_authn_alias.c
Date Wed, 26 Jul 2006 14:20:50 GMT
Author: rpluem
Date: Wed Jul 26 07:20:48 2006
New Revision: 425740

URL: http://svn.apache.org/viewvc?rev=425740&view=rev
Log:
Merge r425210 from trunk:

* Add a check to make sure that the base provider and the alias names are
  different and also that the alias has not been registered before.

PR: 40051
Submitted by: bnicholes
Reviewed by: bnicholes, rpluem, fielding

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/aaa/mod_authn_alias.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=425740&r1=425739&r2=425740&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Jul 26 07:20:48 2006
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.3
 
+  *) mod_authn_alias: Add a check to make sure that the base provider and the
+     alias names are different and also that the alias has not been registered
+     before. PR 40051. [Brad Nicholes]
+
   *) mod_authnz_ldap: Fix a problem with invalid auth error detection for LDAP
      client SDKs that don't support the LDAP_SECURITY_ERROR macro. PR 39529.
      [Ray Price <dohrayme yahoo.com>, Josh Fenlason <jfenlason ptc.com>]

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=425740&r1=425739&r2=425740&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Jul 26 07:20:48 2006
@@ -76,11 +76,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_authn_alias: Add a check to make sure that the base provider 
-       and the alias names are different and also that the alias has 
-       not been registered before. PR#40051
-       http://issues.apache.org/bugzilla/attachment.cgi?id=18636
-       +1: bnicholes, rpluem, fielding
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 

Modified: httpd/httpd/branches/2.2.x/modules/aaa/mod_authn_alias.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/aaa/mod_authn_alias.c?rev=425740&r1=425739&r2=425740&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/aaa/mod_authn_alias.c (original)
+++ httpd/httpd/branches/2.2.x/modules/aaa/mod_authn_alias.c Wed Jul 26 07:20:48 2006
@@ -130,6 +130,7 @@
     char *provider_alias;
     char *provider_name;
     const char *errmsg;
+    const authn_provider *provider = NULL;
     ap_conf_vector_t *new_auth_config = ap_create_per_dir_config(cmd->pool);
     authn_alias_srv_conf *authcfg =
         (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config,
@@ -161,6 +162,19 @@
                            "> directive requires additional arguments", NULL);
     }
 
+    if (strcasecmp(provider_name, provider_alias) == 0) {
+        return apr_pstrcat(cmd->pool,
+                           "The alias provider name must be different from the base provider
name.", NULL);
+    }
+
+    /* Look up the alias provider to make sure that it hasn't already been registered. */
+    provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_alias, "0");
+    if (provider) {
+        return apr_pstrcat(cmd->pool, "The alias provider ", provider_alias,
+                           " has already be registered previously as either a base provider
or an alias provider.",
+                           NULL);
+    }
+
     /* walk the subsection configuration to get the per_dir config that we will
        merge just before the real provider is called. */
     cmd->override = OR_ALL|ACCESS_CONF;
@@ -168,7 +182,7 @@
 
     if (!errmsg) {
         provider_alias_rec *prvdraliasrec = apr_pcalloc(cmd->pool, sizeof(provider_alias_rec));
-        const authn_provider *provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name,"0");
+        provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name, "0");
 
         /* Save off the new directory config along with the original provider name
            and function pointer data */



Mime
View raw message