From: Chris Darroch Date: Mon, 19 May 2008 23:53:05 +0000 (+0000) Subject: Convert common provider version strings ("0") to X-Git-Tag: 2.3.0~606 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9864958fcd92402c3e75dfd538758b66fe0c5255;p=thirdparty%2Fapache%2Fhttpd.git Convert common provider version strings ("0") to AUTHN/Z_PROVIDER_VERSION macros defined in mod_auth.h. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@658046 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e2021099efc..404b252c2a8 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) authn/z: Convert common provider version strings to macros. + *) http_filters: Don't return 100-continue on redirects. PR 43711 [Ruediger Pluem] diff --git a/modules/aaa/mod_auth.h b/modules/aaa/mod_auth.h index 8495f9e572f..c8e8570289d 100644 --- a/modules/aaa/mod_auth.h +++ b/modules/aaa/mod_auth.h @@ -37,6 +37,8 @@ extern "C" { #define AUTHN_PROVIDER_GROUP "authn" #define AUTHZ_PROVIDER_GROUP "authz" +#define AUTHN_PROVIDER_VERSION "0" +#define AUTHZ_PROVIDER_VERSION "0" #define AUTHN_DEFAULT_PROVIDER "file" #define AUTHZ_GROUP_NOTE "authz_group_note" diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index 2bd3b96b5fc..796e29a73c9 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -60,7 +60,8 @@ static const char *add_authn_provider(cmd_parms *cmd, void *config, /* lookup and cache the actual provider now */ newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - newp->provider_name, "0"); + newp->provider_name, + AUTHN_PROVIDER_VERSION); if (newp->provider == NULL) { /* by the time they use it, the provider should be loaded and @@ -211,7 +212,8 @@ static int authenticate_basic_user(request_rec *r) */ if (!current_provider) { provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - AUTHN_DEFAULT_PROVIDER, "0"); + AUTHN_DEFAULT_PROVIDER, + AUTHN_PROVIDER_VERSION); if (!provider || !provider->check_password) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, @@ -286,7 +288,8 @@ static int authenticate_basic_user(request_rec *r) static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp) { - return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, "0"); + return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, + AUTHN_PROVIDER_VERSION); } static void register_hooks(apr_pool_t *p) diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 0ecb101eb32..8760590cd18 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -452,7 +452,8 @@ static const char *add_authn_provider(cmd_parms *cmd, void *config, /* lookup and cache the actual provider now */ newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - newp->provider_name, "0"); + newp->provider_name, + AUTHN_PROVIDER_VERSION); if (newp->provider == NULL) { /* by the time they use it, the provider should be loaded and @@ -1332,7 +1333,8 @@ static authn_status get_hash(request_rec *r, const char *user, */ if (!current_provider) { provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - AUTHN_DEFAULT_PROVIDER, "0"); + AUTHN_DEFAULT_PROVIDER, + AUTHN_PROVIDER_VERSION); if (!provider || !provider->get_realm_hash) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, @@ -1963,7 +1965,8 @@ static int add_auth_info(request_rec *r) static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp) { - return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, "0"); + return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, + AUTHN_PROVIDER_VERSION); } static void register_hooks(apr_pool_t *p) diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index bf0452f62b9..c7f718c8821 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -157,7 +157,8 @@ static const char *add_authn_provider(cmd_parms * cmd, void *config, /* lookup and cache the actual provider now */ newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - newp->provider_name, "0"); + newp->provider_name, + AUTHN_PROVIDER_VERSION); if (newp->provider == NULL) { /* @@ -717,7 +718,8 @@ static int check_authn(request_rec * r, const char *sent_user, const char *sent_ */ if (!current_provider) { provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, - AUTHN_DEFAULT_PROVIDER, "0"); + AUTHN_DEFAULT_PROVIDER, + AUTHN_PROVIDER_VERSION); if (!provider || !provider->check_password) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, LOG_PREFIX diff --git a/modules/aaa/mod_authn_anon.c b/modules/aaa/mod_authn_anon.c index ce8510f6057..9bfd3152211 100644 --- a/modules/aaa/mod_authn_anon.c +++ b/modules/aaa/mod_authn_anon.c @@ -198,7 +198,8 @@ static const authn_provider authn_anon_provider = static void register_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "anon", "0", + ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "anon", + AUTHN_PROVIDER_VERSION, &authn_anon_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authn_core.c b/modules/aaa/mod_authn_core.c index b0c6197fc14..bbe688161ac 100644 --- a/modules/aaa/mod_authn_core.c +++ b/modules/aaa/mod_authn_core.c @@ -227,7 +227,8 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a } /* Look up the alias provider to make sure that it hasn't already been registered. */ - provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_alias, "0"); + provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_alias, + AUTHN_PROVIDER_VERSION); if (provider) { return apr_pstrcat(cmd->pool, "The alias provider ", provider_alias, " has already be registered previously as either a base provider or an alias provider.", @@ -241,7 +242,8 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a if (!errmsg) { provider_alias_rec *prvdraliasrec = apr_pcalloc(cmd->pool, sizeof(provider_alias_rec)); - provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name, "0"); + provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name, + AUTHN_PROVIDER_VERSION); /* Save off the new directory config along with the original provider name and function pointer data */ @@ -253,7 +255,8 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a /* Register the fake provider so that we get called first */ ap_register_auth_provider(cmd->pool, AUTHN_PROVIDER_GROUP, - provider_alias, "0", &authn_alias_provider, + provider_alias, AUTHN_PROVIDER_VERSION, + &authn_alias_provider, AP_AUTH_INTERNAL_PER_CONF); } @@ -298,7 +301,8 @@ static const char *authn_ap_auth_name(request_rec *r) static apr_array_header_t *authn_ap_list_provider_names(apr_pool_t *ptemp) { - return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, "0"); + return ap_list_provider_names(ptemp, AUTHN_PROVIDER_GROUP, + AUTHN_PROVIDER_VERSION); } static const command_rec authn_cmds[] = diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c index 47ce2aa49c9..1a189c51158 100644 --- a/modules/aaa/mod_authn_dbd.c +++ b/modules/aaa/mod_authn_dbd.c @@ -269,7 +269,8 @@ static void authn_dbd_hooks(apr_pool_t *p) &authn_dbd_realm }; - ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "dbd", "0", + ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "dbd", + AUTHN_PROVIDER_VERSION, &authn_dbd_provider, AP_AUTH_INTERNAL_PER_CONF); } module AP_MODULE_DECLARE_DATA authn_dbd_module = diff --git a/modules/aaa/mod_authn_dbm.c b/modules/aaa/mod_authn_dbm.c index abb8df482a8..767e8bb8ef4 100644 --- a/modules/aaa/mod_authn_dbm.c +++ b/modules/aaa/mod_authn_dbm.c @@ -189,7 +189,8 @@ static const authn_provider authn_dbm_provider = static void register_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "dbm", "0", + ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "dbm", + AUTHN_PROVIDER_VERSION, &authn_dbm_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authn_file.c b/modules/aaa/mod_authn_file.c index 2cab61ca908..76aa2e15eec 100644 --- a/modules/aaa/mod_authn_file.c +++ b/modules/aaa/mod_authn_file.c @@ -163,7 +163,8 @@ static const authn_provider authn_file_provider = static void register_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "file", "0", + ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "file", + AUTHN_PROVIDER_VERSION, &authn_file_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index 9c6ac6f6005..d617f5bca65 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -1582,23 +1582,29 @@ static void ImportULDAPOptFn(void) static void register_hooks(apr_pool_t *p) { /* Register authn provider */ - ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "ldap", "0", + ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "ldap", + AUTHN_PROVIDER_VERSION, &authn_ldap_provider, AP_AUTH_INTERNAL_PER_CONF); /* Register authz providers */ - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-user", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-user", + AUTHZ_PROVIDER_VERSION, &authz_ldapuser_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-group", + AUTHZ_PROVIDER_VERSION, &authz_ldapgroup_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-dn", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-dn", + AUTHZ_PROVIDER_VERSION, &authz_ldapdn_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-attribute", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-attribute", + AUTHZ_PROVIDER_VERSION, &authz_ldapattribute_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-filter", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ldap-filter", + AUTHZ_PROVIDER_VERSION, &authz_ldapfilter_provider, AP_AUTH_INTERNAL_PER_CONF); diff --git a/modules/aaa/mod_authz_core.c b/modules/aaa/mod_authz_core.c index d3c4490226f..e1f79048883 100644 --- a/modules/aaa/mod_authz_core.c +++ b/modules/aaa/mod_authz_core.c @@ -346,7 +346,8 @@ static const char *add_authz_provider(cmd_parms *cmd, void *config, /* lookup and cache the actual provider now */ newp->provider = ap_lookup_provider(AUTHZ_PROVIDER_GROUP, - newp->provider_name, "0"); + newp->provider_name, + AUTHZ_PROVIDER_VERSION); newp->req_state = conf->req_state; newp->req_state_level = conf->req_state_level; newp->is_reject = (cmd->info != NULL); @@ -466,8 +467,9 @@ static const char *authz_require_alias_section(cmd_parms *cmd, void *mconfig, if (!errmsg) { provider_alias_rec *prvdraliasrec = apr_pcalloc(cmd->pool, sizeof(provider_alias_rec)); - const authz_provider *provider = ap_lookup_provider(AUTHZ_PROVIDER_GROUP, - provider_name,"0"); + const authz_provider *provider = + ap_lookup_provider(AUTHZ_PROVIDER_GROUP, provider_name, + AUTHZ_PROVIDER_VERSION); /* Save off the new directory config along with the original provider name * and function pointer data @@ -483,7 +485,8 @@ static const char *authz_require_alias_section(cmd_parms *cmd, void *mconfig, /* Register the fake provider so that we get called first */ ap_register_auth_provider(cmd->pool, AUTHZ_PROVIDER_GROUP, - provider_alias, "0", &authz_alias_provider, + provider_alias, AUTHZ_PROVIDER_VERSION, + &authz_alias_provider, AP_AUTH_INTERNAL_PER_CONF); } @@ -804,7 +807,8 @@ static int authz_some_auth_required(request_rec *r) static apr_array_header_t *authz_ap_list_provider_names(apr_pool_t *ptemp) { - return ap_list_provider_names(ptemp, AUTHZ_PROVIDER_GROUP, "0"); + return ap_list_provider_names(ptemp, AUTHZ_PROVIDER_GROUP, + AUTHZ_PROVIDER_VERSION); } static void register_hooks(apr_pool_t *p) diff --git a/modules/aaa/mod_authz_dbd.c b/modules/aaa/mod_authz_dbd.c index 8164a5eeac6..33e2ec87080 100644 --- a/modules/aaa/mod_authz_dbd.c +++ b/modules/aaa/mod_authz_dbd.c @@ -310,13 +310,16 @@ static const authz_provider authz_dbdlogout_provider = static void authz_dbd_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-group", + AUTHZ_PROVIDER_VERSION, &authz_dbdgroup_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-login", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-login", + AUTHZ_PROVIDER_VERSION, &authz_dbdlogin_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-logout", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbd-logout", + AUTHZ_PROVIDER_VERSION, &authz_dbdlogout_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authz_dbm.c b/modules/aaa/mod_authz_dbm.c index e67f699594f..a0d4f910c6e 100644 --- a/modules/aaa/mod_authz_dbm.c +++ b/modules/aaa/mod_authz_dbm.c @@ -272,10 +272,12 @@ static void register_hooks(apr_pool_t *p) { authz_owner_get_file_group = APR_RETRIEVE_OPTIONAL_FN(authz_owner_get_file_group); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbm-group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbm-group", + AUTHZ_PROVIDER_VERSION, &authz_dbmgroup_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbm-file-group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbm-file-group", + AUTHZ_PROVIDER_VERSION, &authz_dbmfilegroup_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authz_groupfile.c b/modules/aaa/mod_authz_groupfile.c index fabf6cdd25b..efa89320209 100644 --- a/modules/aaa/mod_authz_groupfile.c +++ b/modules/aaa/mod_authz_groupfile.c @@ -266,10 +266,12 @@ static void register_hooks(apr_pool_t *p) { authz_owner_get_file_group = APR_RETRIEVE_OPTIONAL_FN(authz_owner_get_file_group); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "group", + AUTHZ_PROVIDER_VERSION, &authz_group_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "file-group", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "file-group", + AUTHZ_PROVIDER_VERSION, &authz_filegroup_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authz_host.c b/modules/aaa/mod_authz_host.c index e6d6ec79d31..a89de780bb5 100644 --- a/modules/aaa/mod_authz_host.c +++ b/modules/aaa/mod_authz_host.c @@ -241,13 +241,17 @@ static const authz_provider authz_all_provider = static void register_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "env", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "env", + AUTHZ_PROVIDER_VERSION, &authz_env_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ip", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ip", + AUTHZ_PROVIDER_VERSION, &authz_ip_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "host", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "host", + AUTHZ_PROVIDER_VERSION, &authz_host_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "all", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "all", + AUTHZ_PROVIDER_VERSION, &authz_all_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authz_owner.c b/modules/aaa/mod_authz_owner.c index 50cbbcae56d..5c8f9298ab1 100644 --- a/modules/aaa/mod_authz_owner.c +++ b/modules/aaa/mod_authz_owner.c @@ -167,7 +167,8 @@ static void register_hooks(apr_pool_t *p) { APR_REGISTER_OPTIONAL_FN(authz_owner_get_file_group); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "file-owner", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "file-owner", + AUTHZ_PROVIDER_VERSION, &authz_fileowner_provider, AP_AUTH_INTERNAL_PER_CONF); } diff --git a/modules/aaa/mod_authz_user.c b/modules/aaa/mod_authz_user.c index 75c21589b08..ea7f8a088f8 100644 --- a/modules/aaa/mod_authz_user.c +++ b/modules/aaa/mod_authz_user.c @@ -81,9 +81,11 @@ static const authz_provider authz_validuser_provider = static void register_hooks(apr_pool_t *p) { - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "user", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "user", + AUTHZ_PROVIDER_VERSION, &authz_user_provider, AP_AUTH_INTERNAL_PER_CONF); - ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "valid-user", "0", + ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "valid-user", + AUTHZ_PROVIDER_VERSION, &authz_validuser_provider, AP_AUTH_INTERNAL_PER_CONF); }