ben 99/08/14 17:01:31
Modified: mpm/src/include http_config.h http_request.h mpm/src/main http_config.c http_core.c http_request.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Auth checker hook Revision Changes Path 1.16 +0 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- http_config.h 1999/08/14 23:46:37 1.15 +++ http_config.h 1999/08/15 00:01:15 1.16 @@ -235,7 +235,6 @@ * sets content_type, _encoding and _language fields. */ - int (*auth_checker) (request_rec *); void (*register_hooks) (void); } module; @@ -356,7 +355,6 @@ int ap_translate_name(request_rec *); int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ -int ap_check_auth(request_rec *); /* check (validated) user is authorized here */ int ap_invoke_handler(request_rec *); /* for mod_perl */ 1.7 +1 -0 apache-2.0/mpm/src/include/http_request.h Index: http_request.h =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_request.h 1999/08/14 23:46:38 1.6 +++ http_request.h 1999/08/15 00:01:16 1.7 @@ -118,6 +118,7 @@ DECLARE_HOOK(int,fixups,(request_rec *)) DECLARE_HOOK(int,type_checker,(request_rec *)) DECLARE_HOOK(int,access_checker,(request_rec *)) +DECLARE_HOOK(int,auth_checker,(request_rec *)) #ifdef __cplusplus } 1.20 +0 -34 apache-2.0/mpm/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- http_config.c 1999/08/14 23:46:39 1.19 +++ http_config.c 1999/08/15 00:01:17 1.20 @@ -250,7 +250,6 @@ { #define m(meth) { XtOffsetOf(module,meth),#meth } - m(auth_checker), { -1, "?" }, #undef m }; @@ -285,12 +284,10 @@ */ static const int method_offsets[] = { - XtOffsetOf(module, auth_checker), }; #define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0])) static struct { - int auth_checker; } offsets_into_method_ptrs; /* @@ -345,37 +342,6 @@ } method_ptrs[next_ptr++] = NULL; } -} - - -static int run_method(request_rec *r, int offset, int run_all) -{ - int i; - - for (i = offset; method_ptrs[i]; ++i) { - handler_func mod_handler = method_ptrs[i]; - - if (mod_handler) { - int result; - - result = (*mod_handler) (r); - - if (result != DECLINED && (!run_all || result != OK)) - return result; - } - } - - return run_all ? OK : DECLINED; -} - -/* Auth stuff --- anything that defines one of these will presumably - * want to define something for the other. Note that check_auth is - * separate from check_access to make catching some config errors easier. - */ - -int ap_check_auth(request_rec *r) -{ - return run_method(r, offsets_into_method_ptrs.auth_checker, 0); } /* 1.19 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- http_core.c 1999/08/14 23:46:40 1.18 +++ http_core.c 1999/08/15 00:01:18 1.19 @@ -2682,6 +2682,5 @@ merge_core_server_configs, /* merge per-server config structures */ core_cmds, /* command table */ core_handlers, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.17 +8 -6 apache-2.0/mpm/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- http_request.c 1999/08/14 23:46:40 1.16 +++ http_request.c 1999/08/15 00:01:20 1.17 @@ -84,6 +84,7 @@ HOOK_LINK(fixups) HOOK_LINK(type_checker) HOOK_LINK(access_checker) + HOOK_LINK(auth_checker) ) IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,(request_rec *r),(r),DECLINED) @@ -91,6 +92,7 @@ IMPLEMENT_HOOK_RUN_ALL(int,fixups,(request_rec *r),(r),OK,DECLINED) IMPLEMENT_HOOK_RUN_FIRST(int,type_checker,(request_rec *r),(r),DECLINED) IMPLEMENT_HOOK_RUN_ALL(int,access_checker,(request_rec *r),(r),OK,DECLINED) +IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,(request_rec *r),(r),DECLINED) /***************************************************************** * @@ -811,11 +813,11 @@ ? ((res = ap_run_access_checker(rnew)) || (ap_some_auth_required(rnew) && ((res = ap_run_check_user_id(rnew)) - || (res = ap_check_auth(rnew))))) + || (res = ap_run_auth_checker(rnew))))) : ((res = ap_run_access_checker(rnew)) && (!ap_some_auth_required(rnew) || ((res = ap_run_check_user_id(rnew)) - || (res = ap_check_auth(rnew))))) + || (res = ap_run_auth_checker(rnew))))) ) || (res = ap_run_type_checker(rnew)) || (res = ap_run_fixups(rnew)) @@ -934,11 +936,11 @@ ? ((res = ap_run_access_checker(rnew)) || (ap_some_auth_required(rnew) && ((res = ap_run_check_user_id(rnew)) - || (res = ap_check_auth(rnew))))) + || (res = ap_run_auth_checker(rnew))))) : ((res = ap_run_access_checker(rnew)) && (!ap_some_auth_required(rnew) || ((res = ap_run_check_user_id(rnew)) - || (res = ap_check_auth(rnew))))) + || (res = ap_run_auth_checker(rnew))))) ) || (res = ap_run_type_checker(rnew)) || (res = ap_run_fixups(rnew)) @@ -1190,7 +1192,7 @@ : "perform authentication. AuthType not set!", r); return; } - if (((access_status = ap_check_auth(r)) != 0) || !ap_auth_type(r)) { + if (((access_status = ap_run_auth_checker(r)) != 0) || !ap_auth_type(r)) { decl_die(access_status, ap_auth_type(r) ? "check access. No groups file?" : "perform authentication. AuthType not set!", r); @@ -1212,7 +1214,7 @@ : "perform authentication. AuthType not set!", r); return; } - if (((access_status = ap_check_auth(r)) != 0) || !ap_auth_type(r)) { + if (((access_status = ap_run_auth_checker(r)) != 0) || !ap_auth_type(r)) { decl_die(access_status, ap_auth_type(r) ? "check access. No groups file?" : "perform authentication. AuthType not set!", r); 1.29 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- prefork.c 1999/08/14 23:46:41 1.28 +++ prefork.c 1999/08/15 00:01:23 1.29 @@ -2984,6 +2984,5 @@ NULL, /* merge per-server config structures */ prefork_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ prefork_hooks, /* register hooks */ }; 1.14 +0 -2 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_access.c 1999/08/14 23:46:42 1.13 +++ mod_access.c 1999/08/15 00:01:24 1.14 @@ -389,7 +389,6 @@ ap_hook_access_checker(check_dir_access,NULL,NULL,HOOK_MIDDLE); } - module MODULE_VAR_EXPORT access_module = { STANDARD20_MODULE_STUFF, @@ -400,6 +399,5 @@ NULL, /* merge server config */ access_cmds, NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_actions.c Index: mod_actions.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_actions.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_actions.c 1999/08/14 23:46:43 1.12 +++ mod_actions.c 1999/08/15 00:01:24 1.13 @@ -218,6 +218,5 @@ NULL, /* merge server config */ action_cmds, /* command table */ action_handlers, /* handlers */ - NULL, /* "check auth */ NULL /* register hooks */ }; 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_alias.c 1999/08/14 23:46:43 1.14 +++ mod_alias.c 1999/08/15 00:01:24 1.15 @@ -413,6 +413,5 @@ merge_alias_config, /* merge server configs */ alias_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.14 +0 -1 apache-2.0/mpm/src/modules/standard/mod_asis.c Index: mod_asis.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_asis.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_asis.c 1999/08/14 23:46:43 1.13 +++ mod_asis.c 1999/08/15 00:01:24 1.14 @@ -133,6 +133,5 @@ NULL, /* merge per-server config structures */ NULL, /* command table */ asis_handlers, /* handlers */ - NULL, /* check auth */ NULL /* register hooks */ }; 1.15 +1 -1 apache-2.0/mpm/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_auth.c 1999/08/14 23:46:43 1.14 +++ mod_auth.c 1999/08/15 00:01:24 1.15 @@ -312,6 +312,7 @@ static void register_hooks(void) { ap_hook_check_user_id(authenticate_basic_user,NULL,NULL,HOOK_MIDDLE); + ap_hook_auth_checker(check_user_access,NULL,NULL,HOOK_MIDDLE); } module MODULE_VAR_EXPORT auth_module = @@ -324,6 +325,5 @@ NULL, /* merge server config */ auth_cmds, /* command table */ NULL, /* handlers */ - check_user_access, /* check auth */ register_hooks /* register hooks */ }; 1.14 +0 -1 apache-2.0/mpm/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_autoindex.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_autoindex.c 1999/08/14 23:46:43 1.13 +++ mod_autoindex.c 1999/08/15 00:01:25 1.14 @@ -1657,6 +1657,5 @@ NULL, /* merge server config */ autoindex_cmds, /* command table */ autoindex_handlers, /* handlers */ - NULL, /* check auth */ NULL /* register hooks */ }; 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_dir.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_dir.c 1999/08/14 23:46:44 1.12 +++ mod_dir.c 1999/08/15 00:01:25 1.13 @@ -231,6 +231,5 @@ NULL, /* merge per-server config structures */ dir_cmds, /* command table */ dir_handlers, /* handlers */ - NULL, /* check auth */ NULL /* register hooks */ }; 1.8 +0 -1 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mod_echo.c 1999/08/14 23:46:44 1.7 +++ mod_echo.c 1999/08/15 00:01:25 1.8 @@ -70,6 +70,5 @@ NULL, /* merge per-server config structures */ echo_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_env.c Index: mod_env.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_env.c 1999/08/14 23:46:44 1.14 +++ mod_env.c 1999/08/15 00:01:25 1.15 @@ -263,6 +263,5 @@ NULL, /* merge server configs */ env_module_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.14 +0 -1 apache-2.0/mpm/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_imap.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_imap.c 1999/08/14 23:46:44 1.13 +++ mod_imap.c 1999/08/15 00:01:25 1.14 @@ -904,6 +904,5 @@ NULL, /* merge server config */ imap_cmds, /* command table */ imap_handlers, /* handlers */ - NULL, /* check auth */ NULL /* register hooks */ }; 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_log_config.c 1999/08/14 23:46:44 1.14 +++ mod_log_config.c 1999/08/15 00:01:26 1.15 @@ -1130,6 +1130,5 @@ merge_config_log_state, /* merge server config */ config_log_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_mime.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_mime.c 1999/08/14 23:46:45 1.12 +++ mod_mime.c 1999/08/15 00:01:26 1.13 @@ -394,6 +394,5 @@ NULL, /* merge per-server config structures */ mime_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.14 +0 -1 apache-2.0/mpm/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_negotiation.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_negotiation.c 1999/08/14 23:46:45 1.13 +++ mod_negotiation.c 1999/08/15 00:01:26 1.14 @@ -2740,6 +2740,5 @@ NULL, /* merge server config */ negotiation_cmds, /* command table */ negotiation_handlers, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_setenvif.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_setenvif.c 1999/08/14 23:46:45 1.14 +++ mod_setenvif.c 1999/08/15 00:01:26 1.15 @@ -415,7 +415,6 @@ merge_setenvif_config, /* merge server configs */ setenvif_module_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ }; 1.15 +0 -1 apache-2.0/mpm/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_userdir.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_userdir.c 1999/08/14 23:46:45 1.14 +++ mod_userdir.c 1999/08/15 00:01:26 1.15 @@ -343,6 +343,5 @@ NULL, /* merge server config */ userdir_cmds, /* command table */ NULL, /* handlers */ - NULL, /* check auth */ register_hooks /* register hooks */ };