From: Nick Kew Date: Mon, 19 Jul 2010 23:40:25 +0000 (+0000) Subject: Enable SetEnv to set PATH X-Git-Tag: 2.3.7~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=344a7acdc3048e11cc9d56230200252e7ecc6a32;p=apache Enable SetEnv to set PATH PR 43906 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965679 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 70de85207c..6b82bb6c40 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,9 @@ Changes with Apache 2.3.7 *) mod_include: recognise "text/html; parameters" as text/html PR 49616 [Andrey Chernov ] + *) CGI vars: allow PATH to be set by SetEnv, consistent with LD_LIBRARY_PATH + PR 43906 [Nick Kew] + Changes with Apache 2.3.6 *) SECURITY: CVE-2009-3555 (cve.mitre.org) diff --git a/server/util_script.c b/server/util_script.c index bf70a9f0d3..de6d4440ba 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -182,7 +182,11 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) } } - if (!(env_path = getenv("PATH"))) { + env_path = apr_table_get(r->subprocess_env, "PATH"); + if (env_path == NULL) { + env_path = getenv("PATH"); + } + if (env_path == NULL) { env_path = DEFAULT_PATH; } apr_table_addn(e, "PATH", apr_pstrdup(r->pool, env_path));