]> granicus.if.org Git - apache/commitdiff
Merge r1795635 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 30 May 2017 12:25:13 +0000 (12:25 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 30 May 2017 12:25:13 +0000 (12:25 +0000)
When processing a 'SetEnv' directive, warn if the environment variable name includes a '='. It is likely a configuration error.   PR 60249
Submitted by: jailletc36
Reviewed by: jailletc36, covener, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796853 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/metadata/mod_env.c

diff --git a/CHANGES b/CHANGES
index 7a07d99277d7ece1b67c7c113ca988b4f09b1a3c..ddf722da2a2578a0fd836cd89ba895795a688562 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -18,6 +18,10 @@ Changes with Apache 2.4.26
   *) core: EBCDIC fixes for interim responses with additional headers.
      [Eric Covener]
 
+  *) 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/STATUS b/STATUS
index a52af1f092c21b9bad8c621748e3e278aae39bad..28add1d0f4283e204fc9240b7ab5fd55527615f7 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -120,13 +120,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_env: When processing a 'SetEnv' directive, warn if the environment
-     variable name includes a '='. It is likely a configuration error.
-     PR 60249.
-     trunk patch: http://svn.apache.org/r1795635
-     2.4.x patch:  svn merge -c 1795635 ^/httpd/httpd/trunk . (modulo CHANGES)
-     +1: jailletc36, covener, ylavic
-
   *) mod_ssl: Consistently pass the expected bio_filter_in_ctx_t
      to ssl_io_filter_error(). [Yann Ylavic]
      trunk patch: http://svn.apache.org/r1796343
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
      */