summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Knauf <fuankg@apache.org>2011-04-17 16:38:42 +0000
committerGuenter Knauf <fuankg@apache.org>2011-04-17 16:38:42 +0000
commit43e53dc11ecce2201b65dc7471e473bf61560d44 (patch)
tree8d011ba0f252f7c95821d17303e62fa6bae6c8e5
parent0a36639ec0366ff9f1b085dd44ca6e0cb7afdf2b (diff)
downloadhttpd-43e53dc11ecce2201b65dc7471e473bf61560d44.tar.gz
Added shebang check for '! so that .vbs scripts can work as CGI.
Backport of r1054347 from trunk; reviewed by wrowe, trawick. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1094174 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES4
-rw-r--r--STATUS7
-rw-r--r--modules/arch/win32/mod_win32.c9
3 files changed, 10 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index 736dfe9aa3..3f259ce6f0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
-*- coding: utf-8 -*-
Changes with Apache 2.2.18
+ *) mod_win32: Added shebang check for '! so that .vbs scripts can work as CGI.
+ Win32's cscript interpreter can only use a single quote as comment char.
+ [Guenter Knauf]
+
*) configure: Fix htpasswd/htdbm libcrypt link errors with some newer
linkers. [Stefan Fritsch]
diff --git a/STATUS b/STATUS
index b383640138..c6c43e461c 100644
--- a/STATUS
+++ b/STATUS
@@ -91,13 +91,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_win32: Add shebang check so that .vbs scripts can work as CGI.
- Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1054347
- 2.2.x patch: Trunk version of patch works with offset
- +1 fuankg, wrowe, trawick
- wrowe notes: CHANGES needs to be clearer than the text above.
- Trunk/CHANGES and 2.2.x/CHANGES need an update.
-
* htpasswd.c: Syncronize with trunk version. This includes a couple of fixes:
r826805, r826822, r829162, r829355, r829431. The patch below covers only
the C code - we also need to apply the docs and CHANGES parts of r826805.
diff --git a/modules/arch/win32/mod_win32.c b/modules/arch/win32/mod_win32.c
index 181f66d766..c2397ea175 100644
--- a/modules/arch/win32/mod_win32.c
+++ b/modules/arch/win32/mod_win32.c
@@ -475,8 +475,11 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
memmove(buffer, buffer + 3, bytes -= 3);
}
- /* Script or executable, that is the question... */
- if ((bytes >= 2) && (buffer[0] == '#') && (buffer[1] == '!')) {
+ /* Script or executable, that is the question...
+ * we check here also for '! so that .vbs scripts can work as CGI.
+ */
+ if ((bytes >= 2) && ((buffer[0] == '#') || (buffer[0] == '\''))
+ && (buffer[1] == '!')) {
/* Assuming file is a script since it starts with a shebang */
for (i = 2; i < bytes; i++) {
if ((buffer[i] == '\r') || (buffer[i] == '\n')) {
@@ -511,7 +514,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
if (!interpreter) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"%s is not executable; ensure interpreted scripts have "
- "\"#!\" first line", *cmd);
+ "\"#!\" or \"'!\" first line", *cmd);
return APR_EBADF;
}