From 3983c8b6cd7e4da42a251ead8dfc1997b27aae19 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 5 Jun 2000 20:45:08 +0000 Subject: [PATCH] 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 --- server/util_script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/util_script.c b/server/util_script.c index 4f1731b985..cea70954f9 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -258,6 +258,7 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r) if (!(env_path = getenv("PATH"))) { env_path = DEFAULT_PATH; } + ap_table_addn(e, "PATH", ap_pstrdup(r->pool, env_path)); #ifdef WIN32 if (env_temp = getenv("SystemRoot")) { @@ -286,7 +287,6 @@ API_EXPORT(void) ap_add_common_vars(request_rec *r) } #endif - ap_table_addn(e, "PATH", env_path); ap_table_addn(e, "SERVER_SIGNATURE", ap_psignature("", r)); ap_table_addn(e, "SERVER_SOFTWARE", ap_get_server_version()); ap_table_addn(e, "SERVER_NAME", ap_get_server_name(r));