Remove cmd.exe dependency in Enscript for Windows
Provides native Win32 open source ports and utilities
Brought to you by:
gnuwin32
Starting with XP-Pro Microsoft has locked down cmd.exe
such that the internet user IUSR_<computername> is
denied all access to cmd.exe.
This impacts ViewCvs in the Enscript usage to colorize
code. It simply will not work anymore....
The only way to get it to work is to relax the
permissions on cmd.exe, but I feel this is
counterproductive because many IS persons will not
allow this on corporate servers.
So please remove this dependency by creating the sed
or whatever other processes Enscript uses directly via
CreateProcess rather than calling cmd.exe.
Bo Berglund
bo.berglund@telia.com
Logged In: YES
user_id=217802
This feature request has been implemented. A new release is
available from http://gnuwin32.sourceforge.net/
Logged In: NO
I downloaded enscript-1.6.3-9-bin.zip to test the change
with ViewCvs, but unfortunately it still requires that cmd.exe
be available to the Internet Guest Account.
Debug error message from ViewCvs:
Traceback (most recent call last):
File "C:\Programs\ViewCvs\lib\win32popen.py", line 182, in
SpoolWorker hr, bytes = win32file.WriteFile(destHandle, data)
api_error: (232, 'WriteFile', 'The pipe is being closed.')
With cmd.exe open for execution by Internet Guest Account
this error does not happen.
I don't know exactly where it happens (in ViewCvs code or in
Enscript, but the ViewCvs people directed me to gnuwin32 for
a resolution in enscript...)
Bo Berglund
bo.berglund@telia.com
Logged In: YES
user_id=217802
The present port of Enscript does not use 'system' (look at its
dependencies, e.g with Dependency Walker). 'System' has
been replaced by 'spawn', which in msvcrt.dll has been
implemented by means of CreateProcess. From the error
message, I gather it is a module of ViewCvs that tries to
invoke some invalid command. So, perhaps you should first try
to check the relevant ViewCvs module.
Logged In: YES
user_id=278341
The system() call has been replaced, but enscript still
tries to invoke cmd.exe through a popen() call at util.c
line 1930.
On windows xp & windows 2003 server under IIS, this call
fails and enscript gives an error like:
enscript: couldn't open input filter "states -f
"K:/gnuwin32/share/enscript/hl/enscript.st" -p
"C://.enscript;K:/gnuwin32/share/enscript/hl" -scpp
-Dcolor=1 -Dstyle=emacs -Dlanguage=html -Dnum_input_files=1
-Ddocument_title="Enscript Output" -Dtoc=0 -" for file "":
Success
Logged In: YES
user_id=217802
It seems popen itself, i.e. its implementation in msvcrt.dll,
calls cmd.exe. I don't see how this can be changed, apart
from writing a new implementation of popen.