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 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]
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
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);
}
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);
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,
{
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 =
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);
#include "mod_request.h"
#include "mod_core.h"
+#include "mod_auth.h"
#if APR_HAVE_STDARG_H
#include <stdarg.h>
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;
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;