]> granicus.if.org Git - apache/commitdiff
Flip the order. If the user specifies ScriptInterpreterSource,
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 12 Apr 2002 06:35:15 +0000 (06:35 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 12 Apr 2002 06:35:15 +0000 (06:35 +0000)
  either Registry or RegistryStrict, test the registry in preference
  over a shebang line.  This is how 1.3 behaved, and allows scripts
  with invalid shebang lines (straight from another box, for example)
  to run without modification.

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

modules/arch/win32/mod_win32.c

index f51ec0672a103370e084720c145b593a0a80ab47..fb5300d846e2f56184c25c43b22f37d3a60ce210 100644 (file)
@@ -439,6 +439,23 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
                 || !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) {
         interpreter = "";
     }
+    if (!interpreter && ext 
+          && (d->script_interpreter_source 
+                     == INTERPRETER_SOURCE_REGISTRY
+           || d->script_interpreter_source 
+                     == INTERPRETER_SOURCE_REGISTRY_STRICT)) {
+         /* Check the registry */
+        int strict = (d->script_interpreter_source 
+                      == INTERPRETER_SOURCE_REGISTRY_STRICT);
+        interpreter = get_interpreter_from_win32_registry(r->pool, ext,
+                                                          strict);
+        if (!interpreter) {
+            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'.", 
+                 ext);
+        }
+    }
     if (!interpreter) {
         apr_status_t rv;
         char buffer[1024];
@@ -489,21 +506,6 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
             }
         }
     }
-    if (!interpreter && ext &&
-        (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY
-         || d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY_STRICT)) {
-         /* Check the registry */
-        int strict = (d->script_interpreter_source 
-                      == INTERPRETER_SOURCE_REGISTRY_STRICT);
-        interpreter = get_interpreter_from_win32_registry(r->pool, ext,
-                                                          strict);
-        if (!interpreter) {
-            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'.", 
-                 ext);
-        }
-    }
     if (!interpreter) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
                       "%s is not executable; ensure interpreted scripts have "