diff options
author | Bradley Nicholes <bnicholes@apache.org> | 2006-07-25 00:33:43 +0200 |
---|---|---|
committer | Bradley Nicholes <bnicholes@apache.org> | 2006-07-25 00:33:43 +0200 |
commit | 82c0c621f6b93035866dbe094c880e17fe3e4222 (patch) | |
tree | 30eec6ce6dcc48255353934b7c1293dc2bb66431 /modules/aaa | |
parent | ScriptSock has been global-only for a couple of years (diff) | |
download | apache2-82c0c621f6b93035866dbe094c880e17fe3e4222.tar.xz apache2-82c0c621f6b93035866dbe094c880e17fe3e4222.zip |
Add a check to make sure that the base provider and the alias names are different and also that the alias has not been registered before
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/aaa')
-rw-r--r-- | modules/aaa/mod_authn_core.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/aaa/mod_authn_core.c b/modules/aaa/mod_authn_core.c index 8a88f43753..69b4c753e3 100644 --- a/modules/aaa/mod_authn_core.c +++ b/modules/aaa/mod_authn_core.c @@ -191,6 +191,7 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a char *provider_alias; char *provider_name; const char *errmsg; + const authn_provider *provider = NULL; ap_conf_vector_t *new_auth_config = ap_create_per_dir_config(cmd->pool); authn_alias_srv_conf *authcfg = (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config, @@ -222,6 +223,19 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a "> directive requires additional arguments", NULL); } + if (strcasecmp(provider_name, provider_alias) == 0) { + return apr_pstrcat(cmd->pool, + "The alias provider name must be different from the base provider name.", NULL); + } + + /* 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"); + 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.", + NULL); + } + /* walk the subsection configuration to get the per_dir config that we will merge just before the real provider is called. */ cmd->override = OR_ALL|ACCESS_CONF; @@ -229,7 +243,7 @@ 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)); - const authn_provider *provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name,"0"); + provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name, "0"); /* Save off the new directory config along with the original provider name and function pointer data */ |