diff options
author | Christophe Jaillet <jailletc36@apache.org> | 2017-05-19 22:51:51 +0200 |
---|---|---|
committer | Christophe Jaillet <jailletc36@apache.org> | 2017-05-19 22:51:51 +0200 |
commit | 182db5c2af0c7459296744afb840ae57c8310451 (patch) | |
tree | 3b28069a4af87362a53a04d0b7ed70b65ace60af /modules/metadata/mod_env.c | |
parent | Added security_tips.xml.es and related files, included built html.es (diff) | |
download | apache2-182db5c2af0c7459296744afb840ae57c8310451.tar.xz apache2-182db5c2af0c7459296744afb840ae57c8310451.zip |
When processing a 'SetEnv' directive, warn if the environment variable name includes a '='. It is likely a configuration error. PR 60249
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1795635 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/metadata/mod_env.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/metadata/mod_env.c b/modules/metadata/mod_env.c index e3e1d4e061..081ee549f3 100644 --- a/modules/metadata/mod_env.c +++ b/modules/metadata/mod_env.c @@ -113,6 +113,17 @@ static const char *add_env_module_vars_set(cmd_parms *cmd, void *sconf_, { env_dir_config_rec *sconf = sconf_; + if (ap_strchr_c(name, '=')) { + char *env, *plast; + + env = apr_strtok(apr_pstrdup(cmd->temp_pool, name), "=", &plast); + + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(10032) + "Spurious usage of '=' in an environment variable name. " + "'%s %s %s' expected instead?", cmd->cmd->name, env, plast); + + } + /* name is mandatory, value is optional. no value means * set the variable to an empty string */ |