You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2003/01/06 07:13:44 UTC
cvs commit: httpd-2.0/modules/aaa mod_authz_user.c
nd 2003/01/05 22:13:44
Modified: modules/aaa mod_authz_user.c
Log:
some cleanup.
- The weird bit mask handling is not really neccessary.
- call ap_note_auth_failure instead of ap_note_basic_auth_failure
Revision Changes Path
1.3 +5 -18 httpd-2.0/modules/aaa/mod_authz_user.c
Index: mod_authz_user.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_authz_user.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_authz_user.c 8 Dec 2002 21:16:05 -0000 1.2
+++ mod_authz_user.c 6 Jan 2003 06:13:44 -0000 1.3
@@ -111,7 +111,7 @@
&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 @@
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 @@
/* 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 @@
}
}
- 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 @@
"'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;
}