httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39401] New: - 16-bit CGI COM files not executed properly
Date Tue, 25 Apr 2006 12:26:44 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39401>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39401

           Summary: 16-bit CGI COM files not executed properly
           Product: Apache httpd-2
           Version: 2.0.55
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cgi
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: bugzilla@amadis.freeserve.co.uk


True 16-bit COM files aren't being executed properly in 2.0.55/Win32 in
/CGI-BIN/  Even with stub batch file wrappers.  Platform=XP Home 2002/SP2
Version 5.1.2600

Stub batch wrappers for the same set of COM test files works just fine on the
1.3.x (latest release)

The stub executes and any ECHO statments in the stub are honoured but no COM
output (stdout) appears on 2.0.55. This differs on 1.3.x where the same COM file
will be executed OK via stub. Log files show it is not being spawned and fails
with O/S error 5. The COM files are being identified as CGI by the looks of it
an an attempt is made to spawn but this fails. This has been replicated on a
wide variety of COM files.  The same COM files tested OK over a wide range of
other webserver software e.g. Abyss, Xitami etc. Some execute COMs directly
others require BAT wrappers.

Apache 2.0.55 is running in XP as a service (local system account) and 1.3.34 as
an application via a CMD shell

=============== 2.0.55 Log abstract (com file wrapped in stub BAT wrapper) ==
[Tue Apr 25 12:33:22 2006] [error] [client 127.0.0.1] (OS 5)Access is denied.  :
couldn't create child process: 720005: 23473032.COM
[Tue Apr 25 12:33:23 2006] [error] [client 127.0.0.1] (OS 5)Access is denied.  :
couldn't spawn child process: C:/Program Files/Apache
Group/Apache2/cgi-bin/23473032.COM
============
Batch stub file:
- - - - SNIP - - - -
@echo off
ECHO running com file
xxxxxx.com
ECHO done
- - - - SNIP - - - -

Executing the COM file directly in /CGI-BIN/ even if it outputs the correct text
headers to stdout produces a 500 error with the same log entries in error.log

=== Executing COM file directly from /CGI-BIN/ (2.0.55) ======
[Tue Apr 25 12:52:09 2006] [error] [client 127.0.0.1] (OS 5)Access is denied.  :
couldn't create child process: 720005: 23473032.COM
[Tue Apr 25 12:52:10 2006] [error] [client 127.0.0.1] (OS 5)Access is denied.  :
couldn't spawn child process: C:/Program Files/Apache
Group/Apache2/cgi-bin/23473032.COM
===

COM files may be interpreted as plain text/html on user-downloading from non-CGI
website area (these files have such a content header within the first 3 bytes of
the start of file following a JMP instruction. I guess this may be a browser
fault (Mozilla) but it could be that Apache is attempting a "magic byte"
signature ID which is upset by short executable byte count with following HTML
header content. I mention it in case it is of relevance in how the files are
detected and what method of spawning is chosen for them
- - - SNIP - - -
é=FContent-type: text/html

<!-- 
Converted from M:\BIN\SRC\03132657.txt
By HTML2BAT v1.03a (c) M Shaw - 25th April 2006
- - - SNIP - - -

Example bytes of sample COM file
000000  E9 3D 46 43 6F 6E 74 65 - 6E 74 2D 74 79 70 65 3A  Ú=FContent-type:
000010  20 74 65 78 74 2F 68 74 - 6D 6C 0D 0A 0D 0A 3C 21   text/html&#9668;&#9496;&#9668;&#9496;<!
000020  2D 2D 20 0A 43 6F 6E 76 - 65 72 74 65 64 20 66 72  -- &#9496;Converted fr
000030  6F 6D 20 4D 3A 5C 42 49 - 4E 5C 53 52 43 5C 30 33  om M:\BIN\SRC\03
000040  31 33 32 36 35 37 2E 74 - 78 74 0D 0A 42 79 20 48  132657.txt&#9668;&#9496;By
H
000050  54 4D 4C 32 42 41 54 20 - 76 31 2E 30 33 61 20 28  TML2BAT v1.03a (
000060  63 29 20 4D 20 53 68 61 - 77 20 2D 20 32 35 74 68  c) M Shaw - 25th
000070  20 41 70 72 69 6C 20 32 - 30 30 36 0D 0A 57 65 62   April 2006&#9668;&#9496;Web

Disassembled shows 3 byte JMP 4740 past the program's text contents.
0D4E:0100 E93D46        JMP     4740
0D4E:0103 43            INC     BX   <- data start (HTML header in this case)
0D4E:0104 6F            DB      6F
0D4E:0105 6E            DB      6E
0D4E:0106 7465          JZ      016D
0D4E:0108 6E            DB      6E
0D4E:0109 742D          JZ      0138
0D4E:010B 7479          JZ      0186
0D4E:010D 7065          JO      0174

Although this example is a custom generated COM file it appears to apply to COM
files from other sources and some 16-bit EXE files (which appear to be COM files
in reality) generated by certain compilers. Can produce examples on request.

I've had a quick scan through the source code and in the Bugzilla reports as
well as searching in Google and I'm still stumped. There are a number of similar
reports in Google to error 720005 (OS5).

It looks like the strategy for spawning COM files differs in Apache 2.0.x to
1.3.x but 1.3.x works OK.

Suitable/simple COM test files can be generated free by pasting text or HTML
into an online compiler at http://compiler.amadis.sytes.net and choosing the
"text compiler". Alternatively early compilers such as Turbo Pascal or some
assemblers.

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

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


Mime
View raw message