]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
allow any user id when configured with 'anonymous *'
authorAndré Malo <nd@apache.org>
Sun, 9 Nov 2003 18:21:51 +0000 (18:21 +0000)
committerAndré Malo <nd@apache.org>
Sun, 9 Nov 2003 18:21:51 +0000 (18:21 +0000)
PR: 11428

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101728 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authn_anon.c

index d6adfc579699e5b4d9f8c84bff76f25baf8fb56b..c74e0bc473f2aaf1c0c57be2032046751aa6f0e7 100644 (file)
@@ -119,6 +119,7 @@ typedef struct {
     int logemail;
     int verifyemail;
     int mustemail;
+    int anyuserid;
 } authn_anon_config_rec;
 
 static void *create_authn_anon_dir_config(apr_pool_t *p, char *d)
@@ -129,6 +130,7 @@ static void *create_authn_anon_dir_config(apr_pool_t *p, char *d)
     conf->users = NULL;
 
     conf->nouserid = 0;
+    conf->anyuserid = 0;
     conf->logemail = 1;
     conf->verifyemail = 0;
     conf->mustemail = 1;
@@ -146,10 +148,17 @@ static const char *anon_set_string_slots(cmd_parms *cmd,
     }
 
     /* squeeze in a record */
-    first = conf->users;
-    conf->users = apr_palloc(cmd->pool, sizeof(*conf->users));
-    conf->users->user = apr_pstrdup(cmd->pool, arg);
-    conf->users->next = first;
+    if (!conf->anyuserid) {
+        if (!strcmp(arg, "*")) {
+            conf->anyuserid = 1;
+        }
+        else {
+            first = conf->users;
+            conf->users = apr_palloc(cmd->pool, sizeof(*conf->users));
+            conf->users->user = apr_pstrdup(cmd->pool, arg);
+            conf->users->next = first;
+        }
+    }
 
     return NULL;
 }
@@ -194,6 +203,9 @@ static authn_status check_anonymous(request_rec *r, const char *user,
             res = AUTH_USER_FOUND;
         }
     }
+    else if (conf->anyuserid) {
+        res = AUTH_USER_FOUND;
+    }
     else {
         anon_auth_user *p = conf->users;