1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-02 13:21:21 +03:00

Make a copy of getenv("PATH") before storing for later use. Some

getenv() implementations use the same storage for successive calls.
CGIs on OS/390 had a bad PATH due to this.  (Believe it or not, ANSI
says getenv() can do this.)

Some similar getenv() usage was left alone as it was specific to a
certain platform, and I assume that getenv() doesn't have the "issue"
on those platforms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85427 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jeff Trawick
2000-06-05 20:45:08 +00:00
parent eda6e3d23c
commit 3983c8b6cd

View File

@@ -258,6 +258,7 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r)
if (!(env_path = getenv("PATH"))) { if (!(env_path = getenv("PATH"))) {
env_path = DEFAULT_PATH; env_path = DEFAULT_PATH;
} }
ap_table_addn(e, "PATH", ap_pstrdup(r->pool, env_path));
#ifdef WIN32 #ifdef WIN32
if (env_temp = getenv("SystemRoot")) { if (env_temp = getenv("SystemRoot")) {
@@ -286,7 +287,6 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r)
} }
#endif #endif
ap_table_addn(e, "PATH", env_path);
ap_table_addn(e, "SERVER_SIGNATURE", ap_psignature("", r)); ap_table_addn(e, "SERVER_SIGNATURE", ap_psignature("", r));
ap_table_addn(e, "SERVER_SOFTWARE", ap_get_server_version()); ap_table_addn(e, "SERVER_SOFTWARE", ap_get_server_version());
ap_table_addn(e, "SERVER_NAME", ap_get_server_name(r)); ap_table_addn(e, "SERVER_NAME", ap_get_server_name(r));