]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Pass the command line to the cmd.exe /c interpreter double quoted.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Mar 2002 05:59:30 +0000 (05:59 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Mar 2002 05:59:30 +0000 (05:59 +0000)
  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

src/main/http_core.c

index abab52a2e0231a88bbb81be975b854fbdd27495d..0e1a8f8127880bb1d551549816605e2e12282479 100644 (file)
@@ -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;
     }