You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fu...@apache.org on 2011/04/17 18:38:43 UTC

svn commit: r1094174 - in /httpd/httpd: branches/2.2.x/CHANGES branches/2.2.x/STATUS branches/2.2.x/modules/arch/win32/mod_win32.c trunk/CHANGES

Author: fuankg
Date: Sun Apr 17 16:38:42 2011
New Revision: 1094174

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

Backport of r1054347 from trunk; reviewed by wrowe, trawick.

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c
    httpd/httpd/trunk/CHANGES

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1094174&r1=1094173&r2=1094174&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Sun Apr 17 16:38:42 2011
@@ -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]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1094174&r1=1094173&r2=1094174&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Sun Apr 17 16:38:42 2011
@@ -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.

Modified: httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c?rev=1094174&r1=1094173&r2=1094174&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c (original)
+++ httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c Sun Apr 17 16:38:42 2011
@@ -475,8 +475,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')) {
@@ -511,7 +514,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;
     }
 

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1094174&r1=1094173&r2=1094174&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Apr 17 16:38:42 2011
@@ -64,6 +64,10 @@ Changes with Apache 2.3.12
 
 Changes with Apache 2.3.11
 
+  *) 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]
+
   *) mod_proxy: balancer-manager now uses POST instead of GET.
      [Jim Jagielski]
 



Re: svn commit: r1094174 - in /httpd/httpd: branches/2.2.x/CHANGES branches/2.2.x/STATUS branches/2.2.x/modules/arch/win32/mod_win32.c trunk/CHANGES

Posted by Guenter Knauf <fu...@apache.org>.
Am 17.04.2011 18:38, schrieb fuankg@apache.org:
> Author: fuankg
> Date: Sun Apr 17 16:38:42 2011
> New Revision: 1094174
>
> URL: http://svn.apache.org/viewvc?rev=1094174&view=rev
> Log:
> Added shebang check for '! so that .vbs scripts can work as CGI.
>
> Backport of r1054347 from trunk; reviewed by wrowe, trawick.
>
> Modified:
>      httpd/httpd/branches/2.2.x/CHANGES
>      httpd/httpd/branches/2.2.x/STATUS
>      httpd/httpd/branches/2.2.x/modules/arch/win32/mod_win32.c
>      httpd/httpd/trunk/CHANGES
>
> Modified: httpd/httpd/branches/2.2.x/CHANGES
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1094174&r1=1094173&r2=1094174&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
> +++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Sun Apr 17 16:38:42 2011
> @@ -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]
>
>
> Modified: httpd/httpd/branches/2.2.x/STATUS
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1094174&r1=1094173&r2=1094174&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/STATUS (original)
> +++ httpd/httpd/branches/2.2.x/STATUS Sun Apr 17 16:38:42 2011
> @@ -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.
please check if the CHANGES entry is sufficient or suggest a better 
wording ...

Some samples to test the new feature here:
http://people.apache.org/~fuankg/vbscripts/

Gün.