From e1f570e70ee51a19015b1317ef3524a084f3d660 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Apr 2002 06:35:15 +0000 Subject: [PATCH] Flip the order. If the user specifies ScriptInterpreterSource, 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 | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/arch/win32/mod_win32.c b/modules/arch/win32/mod_win32.c index f51ec0672a..fb5300d846 100644 --- a/modules/arch/win32/mod_win32.c +++ b/modules/arch/win32/mod_win32.c @@ -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 " -- 2.40.0