1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00

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.

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
This commit is contained in:
Chris Darroch
2008-05-22 17:01:14 +00:00
parent f5b8773920
commit fc21f4e72e
7 changed files with 13 additions and 47 deletions

View File

@@ -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]

View 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

View 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);
}

View 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);

View 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 =

View 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);

View 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;