core: Fix incorrect substitution of env vars in directives containing multiple env vars.
In ap_resolve_env(), the string returned from getenv() should be copied since
the returned string may be statically allocated.
This fixes an issue where the value for the last env var is substituted for all
env vars in a directive containing multiple env vars.
Submitted by: hwibell
Reviewed by: hwibell, covener, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1848686 13f79535-47bb-0310-9956-
ffa450edef68
and we should just set the value for the environment variable
like in the pattern case. [Christophe Jaillet]
+ *) core: Incorrect values for environment variables are substituted when
+ multiple environment variables are specified in a directive. [Hank Ibell]
+
*) mod_rewrite: Only create the global mutex used by "RewriteMap prg:" when
this type of map is present in the configuration. PR62311.
[Hank Ibell <hwibell gmail.com>]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) core: Fix incorrect substitution of env vars in directives containing
- multiple env vars. In ap_resolve_env(), the string returned from
- getenv() should be copied since the returned string may be
- statically allocated.
- trunk patch: http://svn.apache.org/r1848236
- 2.4.x patch: svn merge -c 1848236 ^/httpd/httpd/trunk .
- +1: hwibell, covener, jim
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
if (server_config_defined_vars)
word = apr_table_get(server_config_defined_vars, name);
if (!word)
- word = getenv(name);
+ word = apr_pstrdup(p, getenv(name));
if (word) {
current->string = word;
current->len = strlen(word);