]> granicus.if.org Git - apache/commitdiff
If we have a registry command or a shebang line invocation, correct the
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 19:55:00 +0000 (19:55 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 13 Apr 2002 19:55:00 +0000 (19:55 +0000)
  invocation type to APR_PROGRAM_PATH so we will both search the path, and
  accept undecorated names, e.g. "perl" should be acceptable for "perl.exe".

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94636 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/win32/mod_win32.c

index ce7f0d6d30ec8c5b66eb623be84419eb4230f46c..b35fc262cd7d5ecff0a9506a7e1328e00a2e20fa 100644 (file)
@@ -435,6 +435,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
     
     /* If the file has an extension and it is not .com and not .exe and
      * we've been instructed to search the registry, then do so.
+     * Let apr_proc_create do all of the .bat/.cmd dirty work.
      */
     if (ext && (!strcasecmp(ext,".exe") || !strcasecmp(ext,".com")
                 || !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) {
@@ -450,7 +451,10 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
                       == INTERPRETER_SOURCE_REGISTRY_STRICT);
         interpreter = get_interpreter_from_win32_registry(r->pool, ext,
                                                           strict);
-        if (!interpreter) {
+        if (interpreter) {
+            *type = APR_PROGRAM_PATH;
+        }
+        else {
             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server,
                  strict ? "No ExecCGI verb found for files of type '%s'."
                         : "No ExecCGI or Open verb found for files of type '%s'.", 
@@ -490,6 +494,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
                 while (isspace(*interpreter)) {
                     ++interpreter;
                 }
+                *type = APR_PROGRAM_PATH;
             }
         }
         else {