]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
When processing a 'SetEnv' directive, warn if the environment variable name includes...
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 19 May 2017 20:51:51 +0000 (20:51 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 19 May 2017 20:51:51 +0000 (20:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1795635 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/log-message-tags/next-number
modules/metadata/mod_env.c

diff --git a/CHANGES b/CHANGES
index 94448fce64f111579acba4c023b9723fa99465b5..6eb0a52142d963658ae6e0034ad78262cc96acb8 100644 (file)
--- 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]
 
index 0afd8911a0650dfcd987a89d8aa8c1936b85faf8..8e4ede90cc64266d63a374e1014eebd2ed0a57dc 100644 (file)
@@ -1 +1 @@
-10032
+10033
index e3e1d4e06103fada9dd3679e5a77a4bf3d089473..081ee549f35088c4258785b6fd1d6be01b020c4f 100644 (file)
@@ -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
      */