From 550bc4dcb96ea63f85a96d00384804a0663e7f1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Mon, 6 Jan 2003 06:13:44 +0000 Subject: [PATCH] some cleanup. - 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 | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/modules/aaa/mod_authz_user.c b/modules/aaa/mod_authz_user.c index c9e0780c2e..e444f79756 100644 --- a/modules/aaa/mod_authz_user.c +++ b/modules/aaa/mod_authz_user.c @@ -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; } -- 2.40.0