]> granicus.if.org Git - apache/commitdiff
Determine registered authn/z providers directly in ap_setup_auth_internal(),
authorChris Darroch <chrisd@apache.org>
Thu, 22 May 2008 17:01:14 +0000 (17:01 +0000)
committerChris Darroch <chrisd@apache.org>
Thu, 22 May 2008 17:01:14 +0000 (17:01 +0000)
which allows optional functions that just wrapped ap_list_provider_names()
to be removed from authn/z modules.

This change requires modules/aaa/mod_auth.h to be included into
server/request.c, which necessitates a minor change to configure.in for
Unix platforms.

I'm unable to tell whether a similar change is necessary for Windows and
NetWare builds or not.  Could developers with access to those platforms
please test and make any needed configuration or build alterations?  Thanks!

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

CHANGES
configure.in
modules/aaa/mod_auth_basic.c
modules/aaa/mod_auth_digest.c
modules/aaa/mod_authn_core.c
modules/aaa/mod_authz_core.c
server/request.c

diff --git a/CHANGES b/CHANGES
index 25f4a77559ef9f73f4dd9d38d944da292c36af32..2b6c48989d1b71a6dd6f4511d122d2db50dd8b3b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) core, authn/z: Determine registered authn/z providers directly in
+     ap_setup_auth_internal(), which allows optional functions that just
+     wrapped ap_list_provider_names() to be removed from authn/z modules.
+     [Chris Darroch]
+
   *) authn/z: Convert common provider version strings to macros.
      [Chris Darroch]
 
index 06b06d304fc4235aac57412807040cb6ca350fb3..a4d82e9d4ffe9e51cfe13b7701f9a2bfe5921258 100644 (file)
@@ -204,7 +204,7 @@ if test "$abs_builddir" != "$abs_srcdir"; then
   APR_ADDTO(INCLUDES, [-I\$(top_builddir)/include])
 fi
 
-APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/modules/session -I\$(top_srcdir)/include -I\$(top_srcdir)/modules/generators -I\$(top_srcdir)/modules/mappers -I\$(top_srcdir)/modules/database])
+APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/aaa -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/modules/session -I\$(top_srcdir)/include -I\$(top_srcdir)/modules/generators -I\$(top_srcdir)/modules/mappers -I\$(top_srcdir)/modules/database])
 
 # apr/apr-util --includes may pick up system paths for dependent
 # libraries, so ensure these are later in INCLUDES than local source
index 796e29a73c94ddd366bbd546e43d8ce8406dc73c..e641119507eccb1d97a8b2ee9bd8087efde6e448 100644 (file)
@@ -286,16 +286,8 @@ static int authenticate_basic_user(request_rec *r)
     return OK;
 }
 
-static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp)
-{
-    return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP,
-                                  AUTHN_PROVIDER_VERSION);
-}
-
 static void register_hooks(apr_pool_t *p)
 {
-    APR_REGISTER_OPTIONAL_FN(authn_ap_list_provider_names);
-
     ap_hook_check_authn(authenticate_basic_user, NULL, NULL, APR_HOOK_MIDDLE,
                         AP_AUTH_INTERNAL_PER_CONF);
 }
index 8760590cd18f188ff8a9450879138dcf49ab4e04..6dfbea615f2e3442b3159026a217e9462be88940 100644 (file)
@@ -1963,19 +1963,11 @@ static int add_auth_info(request_rec *r)
     return OK;
 }
 
-static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp)
-{
-    return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP,
-                                  AUTHN_PROVIDER_VERSION);
-}
-
 static void register_hooks(apr_pool_t *p)
 {
     static const char * const cfgPost[]={ "http_core.c", NULL };
     static const char * const parsePre[]={ "mod_proxy.c", NULL };
 
-    APR_REGISTER_OPTIONAL_FN(authn_ap_list_provider_names);
-
     ap_hook_post_config(initialize_module, NULL, cfgPost, APR_HOOK_MIDDLE);
     ap_hook_child_init(initialize_child, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_post_read_request(parse_hdr_and_update_nc, parsePre, NULL, APR_HOOK_MIDDLE);
index bbe688161acfb0a5a6a7e67536734db91b7bb87c..649f6c6f084f5c3506a071e1cda4a1dc4e65c76a 100644 (file)
@@ -299,12 +299,6 @@ static const char *authn_ap_auth_name(request_rec *r)
     return apr_pstrdup(r->pool, conf->ap_auth_name);
 }
 
-static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp)
-{
-    return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP,
-                                  AUTHN_PROVIDER_VERSION);
-}
-
 static const command_rec authn_cmds[] =
 {
     AP_INIT_TAKE1("AuthType", ap_set_string_slot,
@@ -322,7 +316,6 @@ static void register_hooks(apr_pool_t *p)
 {
     APR_REGISTER_OPTIONAL_FN(authn_ap_auth_type);
     APR_REGISTER_OPTIONAL_FN(authn_ap_auth_name);
-    APR_REGISTER_OPTIONAL_FN(authn_ap_list_provider_names);
 }
 
 module AP_MODULE_DECLARE_DATA authn_core_module =
index e1f79048883e521328f0cff56fa122a633a8747b..6ba2c4aad4983bc8d061a13054b6ba169edff1e7 100644 (file)
@@ -805,16 +805,9 @@ static int authz_some_auth_required(request_rec *r)
     return req_authz;
 }
 
-static apr_array_header_t *authz_ap_list_provider_names(apr_pool_t *ptemp)
-{   
-    return ap_list_provider_names(ptemp, AUTHZ_PROVIDER_GROUP,
-                                  AUTHZ_PROVIDER_VERSION);
-}
-
 static void register_hooks(apr_pool_t *p)
 {
     APR_REGISTER_OPTIONAL_FN(authz_some_auth_required);
-    APR_REGISTER_OPTIONAL_FN(authz_ap_list_provider_names);
 
     ap_hook_check_authz(authorize_user, NULL, NULL, APR_HOOK_MIDDLE,
                         AP_AUTH_INTERNAL_PER_CONF);
index 159d8a04afd2cd82018ea5ab3625ca198ff6886e..75b79305519d5e2d494d8cfe0f49fc3cc935ecc5 100644 (file)
@@ -48,6 +48,7 @@
 #include "mod_request.h"
 
 #include "mod_core.h"
+#include "mod_auth.h"
 
 #if APR_HAVE_STDARG_H
 #include <stdarg.h>
@@ -1685,10 +1686,6 @@ AP_DECLARE(void) ap_clear_auth_internal(void)
 
 AP_DECLARE(void) ap_setup_auth_internal(apr_pool_t *ptemp)
 {
-    APR_OPTIONAL_FN_TYPE(authn_ap_list_provider_names)
-        *authn_ap_list_provider_names;
-    APR_OPTIONAL_FN_TYPE(authz_ap_list_provider_names)
-        *authz_ap_list_provider_names;
     int total_auth_hooks = 0;
     int total_auth_providers = 0;
 
@@ -1708,18 +1705,12 @@ AP_DECLARE(void) ap_setup_auth_internal(apr_pool_t *ptemp)
         return;
     }
 
-    authn_ap_list_provider_names =
-        APR_RETRIEVE_OPTIONAL_FN(authn_ap_list_provider_names);
-    authz_ap_list_provider_names =
-        APR_RETRIEVE_OPTIONAL_FN(authz_ap_list_provider_names);
-
-    if (authn_ap_list_provider_names) {
-        total_auth_providers += authn_ap_list_provider_names(ptemp)->nelts;
-    }
-
-    if (authz_ap_list_provider_names) {
-        total_auth_providers += authz_ap_list_provider_names(ptemp)->nelts;
-    }
+    total_auth_providers +=
+        ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP,
+                               AUTHN_PROVIDER_VERSION)->nelts;
+    total_auth_providers +=
+        ap_list_provider_names(ptemp, AUTHZ_PROVIDER_GROUP,
+                               AUTHZ_PROVIDER_VERSION)->nelts;
 
     if (total_auth_providers > auth_internal_per_conf_providers) {
         return;