From: William A. Rowe Jr Date: Thu, 21 Mar 2002 05:59:30 +0000 (+0000) Subject: Pass the command line to the cmd.exe /c interpreter double quoted. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=142f22d2f5f59a2d27be0640f707ad74d62128c4;p=thirdparty%2Fapache%2Fhttpd.git Pass the command line to the cmd.exe /c interpreter double quoted. This fixes a bug that CGI args ending in a double-quote would cause invocation to fail. Just fixed the converse problem in Apache 2.0, where assumed they all acted as cmd.exe, which command.com will not. [William Rowe] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94075 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/main/http_core.c b/src/main/http_core.c index abab52a2e02..0e1a8f81278 100644 --- a/src/main/http_core.c +++ b/src/main/http_core.c @@ -994,9 +994,11 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r, *interpreter = ap_pstrcat(r->pool, "\"", shellcmd, "\" /C %1", NULL); } else - /* Assume any other likes long paths, and knows .cmd + /* Assume any other likes long paths, and knows .cmd, + * but the entire /c arg should be double quoted, e.g. + * "c:\path\cmd.exe" /c ""prog" "arg" "arg"" */ - *interpreter = ap_pstrcat(r->pool, "\"", shellcmd, "\" /C \"%1\"", NULL); + *interpreter = ap_pstrcat(r->pool, "\"", shellcmd, "\" /C \"\"%1\" %*\"", NULL); return eFileTypeSCRIPT; }