From 659671c90ed103afc979a0874763649b5499874f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 19 Sep 2006 12:36:02 +0000 Subject: [PATCH] - patch is back: always use /bin/sh when executing subshell Changed files: lighttpd-use_bin_sh.patch -> 1.3 --- lighttpd-use_bin_sh.patch | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lighttpd-use_bin_sh.patch diff --git a/lighttpd-use_bin_sh.patch b/lighttpd-use_bin_sh.patch new file mode 100644 index 0000000..dd1f9a4 --- /dev/null +++ b/lighttpd-use_bin_sh.patch @@ -0,0 +1,40 @@ +## Use /bin/sh to execute external programs instead of getting +## the shell from $SHELL (See ticket #388) +# +# http://trac.lighttpd.net/trac/ticket/388 + +--- lighttpd-1.4.12/src/proc_open.c~ 2006-09-19 15:32:30.253386029 +0300 ++++ lighttpd-1.4.12/src/proc_open.c 2006-09-19 15:33:59.405384132 +0300 +@@ -148,17 +148,9 @@ + STARTUPINFO si; + BOOL procok; + SECURITY_ATTRIBUTES security; +- const char *shell = NULL; +- const char *windir = NULL; ++ const char *shell = "/bin/sh"; + buffer *cmdline; + +- if (NULL == (shell = getenv(SHELLENV)) && +- NULL == (windir = getenv("SystemRoot")) && +- NULL == (windir = getenv("windir"))) { +- fprintf(stderr, "One of %s,%%SystemRoot,%%windir is required", SHELLENV); +- return -1; +- } +- + /* we use this to allow the child to inherit handles */ + memset(&security, 0, sizeof(security)); + security.nLength = sizeof(security); +@@ -180,12 +172,7 @@ + memset(&pi, 0, sizeof(pi)); + + cmdline = buffer_init(); +- if (shell) { +- buffer_append_string(cmdline, shell); +- } else { +- buffer_append_string(cmdline, windir); +- buffer_append_string(cmdline, "\\system32\\cmd.exe"); +- } ++ buffer_append_string(cmdline, shell); + buffer_append_string_len(cmdline, CONST_STR_LEN(" /c ")); + buffer_append_string(cmdline, command); + procok = CreateProcess(NULL, cmdline->ptr, &security, &security, TRUE, -- 2.44.0