summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorGlenn L McGrath2003-09-10 23:35:45 +0000
committerGlenn L McGrath2003-09-10 23:35:45 +0000
commitfe538ba5d68391562b23d9d0902b4219b6329cad (patch)
treed05f7774202a614cf9ac1174f6a8206aeab5b94a /networking
parent87af49f26b2293ab60d0f13d2a14cad66e02a6ff (diff)
downloadbusybox-fe538ba5d68391562b23d9d0902b4219b6329cad.zip
busybox-fe538ba5d68391562b23d9d0902b4219b6329cad.tar.gz
Vodz, last_patch_104
Diffstat (limited to 'networking')
-rw-r--r--networking/httpd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 251eee0..60dbba4 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1172,7 +1172,6 @@ static int sendCgi(const char *url,
*script = '/'; /* is directory, find next '/' */
}
addEnv("PATH", "INFO", script); /* set /PATH_INFO or NULL */
- addEnv("PATH", "", getenv("PATH"));
addEnv("REQUEST", "METHOD", request);
if(urlArgs) {
char *uri = alloca(strlen(purl) + 2 + strlen(urlArgs));
@@ -1996,6 +1995,19 @@ int httpd_main(int argc, char *argv[])
# endif
#endif
+#ifdef CONFIG_FEATURE_HTTPD_CGI
+ {
+ char *p = getenv("PATH");
+
+ if(p)
+ p = bb_xstrdup(p);
+ clearenv();
+ if(p) {
+ setenv("PATH", p, 0);
+ }
+ }
+#endif
+
#ifdef CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
sighup_handler(0);
#else