summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2017-05-19 20:51:51 +0000
committerChristophe Jaillet <jailletc36@apache.org>2017-05-19 20:51:51 +0000
commit182db5c2af0c7459296744afb840ae57c8310451 (patch)
tree3b28069a4af87362a53a04d0b7ed70b65ace60af
parent971329dee0062656ce0a9a4a8793a0620b4d4ec9 (diff)
downloadhttpd-182db5c2af0c7459296744afb840ae57c8310451.tar.gz
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
-rw-r--r--CHANGES4
-rw-r--r--docs/log-message-tags/next-number2
-rw-r--r--modules/metadata/mod_env.c11
3 files changed, 16 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 94448fce64..6eb0a52142 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 0afd8911a0..8e4ede90cc 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 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
*/