You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/06/11 17:48:31 UTC

DO NOT REPLY [Bug 51359] New: Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

             Bug #: 51359
           Summary: Added shebang check for //! so that .js scripts work
                    as CGI based on similar .vbs from [Guenter Knauf]
           Product: Apache httpd-2
           Version: 2.2.17
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: mpm_winnt
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: kmashint@yahoo.com
    Classification: Unclassified


Created attachment 27147
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27147
mod_win32_js_cgi_for_trunk

Related to this addition in Apache 2.2.18:
  *) mod_win32: Added shebang check for '! so that .vbs scripts work as CGI.
     Win32's cscript interpreter can only use a single quote as comment char.
     [Guenter Knauf]

I've also added handling for //! so that .js scripts work as CGI.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

Keith Mashinter <km...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #27147|0                           |1
        is obsolete|                            |

--- Comment #2 from Keith Mashinter <km...@yahoo.com> 2011-06-11 15:49:45 UTC ---
Created attachment 27149
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27149
mod_win32_js_cgi_for_trunk

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

Guenter Knauf <ef...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #4 from Guenter Knauf <ef...@gmx.net> ---
You can now already run JScript code if you wrap it into a wsf file; f.e.
create a testjs.wsf in cgi-bin folder with content:
'!c:/windows/system32/cscript -nologo
<job>
<script language="JScript">
  WSH.Echo("Content-type: text/plain\n");
  WSH.Echo("Hello world from " + ScriptEngine() + " !");
</script>
</job>

isnt this sufficient?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

--- Comment #5 from Keith Mashinter <km...@yahoo.com> ---
Created attachment 31833
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31833&action=edit
I've added a patch for 2.5-HEAD.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

--- Comment #1 from Keith Mashinter <km...@yahoo.com> 2011-06-11 15:49:17 UTC ---
Created attachment 27148
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27148
mod_win32_js_cgi_for_2_2_19

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

--- Comment #3 from Keith Mashinter <km...@yahoo.com> 2011-06-15 04:28:15 UTC ---
I've tested with simple cgi-bin/test.js that works to launch the script with
cscript.exe //nologo.

//!cscript.exe //nologo
WScript.Echo("Content-Type: text/plain");
WScript.Echo("");
WScript.Echo("Hello World!");

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51359] Added shebang check for //! so that .js scripts work as CGI based on similar .vbs from [Guenter Knauf]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51359

--- Comment #6 from Keith Mashinter <km...@yahoo.com> ---
As to the use of  *.wsf, this does seems to work but is a bit awkward having
Javascript within XML.  Also, allowing //! for JS files would allow for other
*.js engines to run on other platforms, e.g. launching node x.js if desired.

That said, this hack does seem to work, having a trailing single-quote to
appease JScript compilation while allowing for the vbscript style comment.

'!c:/windows/system32/cscript -nologo test.js '
WSH.Echo("Content-type: text/plain\n");
WSH.Echo("Hello world from " + ScriptEngine() + " !");

Given the dwindling support for older Windows Scripting, it's not a high
priority and can be closed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org