httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1054347 - /httpd/httpd/trunk/modules/arch/win32/mod_win32.c
Date Sun, 02 Jan 2011 04:33:28 GMT
Author: fuankg
Date: Sun Jan  2 04:33:28 2011
New Revision: 1054347

URL: http://svn.apache.org/viewvc?rev=1054347&view=rev
Log:
Added shebang check so that .vbs scripts can work as CGI.

Modified:
    httpd/httpd/trunk/modules/arch/win32/mod_win32.c

Modified: httpd/httpd/trunk/modules/arch/win32/mod_win32.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/win32/mod_win32.c?rev=1054347&r1=1054346&r2=1054347&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/win32/mod_win32.c (original)
+++ httpd/httpd/trunk/modules/arch/win32/mod_win32.c Sun Jan  2 04:33:28 2011
@@ -468,8 +468,11 @@ static apr_status_t ap_cgi_build_command
             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')) {
@@ -504,7 +507,7 @@ static apr_status_t ap_cgi_build_command
     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;
     }
 



Mime
View raw message