From: Christophe Jaillet Date: Fri, 19 May 2017 20:51:51 +0000 (+0000) Subject: When processing a 'SetEnv' directive, warn if the environment variable name includes... X-Git-Tag: 2.5.0-alpha~414 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=182db5c2af0c7459296744afb840ae57c8310451;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/CHANGES b/CHANGES index 94448fce64f..6eb0a52142d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_env: when processing a 'SetEnv' directive, warn if the environment + variable name includes a '='. It is likely a configuration error. + PR 60249 [Christophe Jaillet] + *) Evaluate nested If/ElseIf/Else configuration blocks. [Luca Toscano, Jacob Champion] diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index 0afd8911a06..8e4ede90cc6 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10032 +10033 diff --git a/modules/metadata/mod_env.c b/modules/metadata/mod_env.c index e3e1d4e0610..081ee549f35 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 */