]> granicus.if.org Git - apache/commitdiff
some cleanup.
authorAndré Malo <nd@apache.org>
Mon, 6 Jan 2003 06:13:44 +0000 (06:13 +0000)
committerAndré Malo <nd@apache.org>
Mon, 6 Jan 2003 06:13:44 +0000 (06:13 +0000)
- The weird bit mask handling is not really neccessary.
- call ap_note_auth_failure instead of ap_note_basic_auth_failure

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

modules/aaa/mod_authz_user.c

index c9e0780c2e445d76bc18ae97bac654bec5977a58..e444f7975625eab6da5f58c92d6a21a2383f4a04 100644 (file)
@@ -111,7 +111,7 @@ static int check_user_access(request_rec *r)
                                                        &authz_user_module);
     char *user = r->user;
     int m = r->method_number;
-    int method_restricted = 0;
+    int required_user = 0;
     register int x;
     const char *t, *w;
     const apr_array_header_t *reqs_arr = ap_requires(r);
@@ -131,10 +131,6 @@ static int check_user_access(request_rec *r)
             continue;
         }
 
-        /* Note that there are applicable requirements 
-         */
-        method_restricted |= 1;
-
         t = reqs[x].requirement;
         w = ap_getword_white(r->pool, &t);
         if (!strcmp(w, "valid-user")) {
@@ -144,7 +140,7 @@ static int check_user_access(request_rec *r)
             /* And note that there are applicable requirements 
              * which we consider ourselves the owner of.
              */
-            method_restricted |= 2;
+            required_user = 1;
             while (t[0]) {
                 w = ap_getword_conf(r->pool, &t);
                 if (!strcmp(user, w)) {
@@ -154,17 +150,8 @@ static int check_user_access(request_rec *r)
         }
     }
 
-    if (method_restricted == 0) {
-        /* no applicable requirements at all */
-        return DECLINED;
-    }
-    /* There are require methods which we do not
-     * understand. 
-     */
-    if ((method_restricted & 2) == 0) {
-        /* no requirements of which we consider ourselves
-         * the owner.
-         */
+    if (!required_user) {
+        /* no applicable requirements */
         return DECLINED;
     }
 
@@ -177,7 +164,7 @@ static int check_user_access(request_rec *r)
                   "'require'ments for user/valid-user to be allowed access",
                   r->uri, user);
         
-    ap_note_basic_auth_failure(r);
+    ap_note_auth_failure(r);
     return HTTP_UNAUTHORIZED;
 }