www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toni Harbaugh <harba...@ncifcrf.gov>
Subject os-windows/2495: #! syntax fails because filename of script (which contains spaces) is not quoted
Date Wed, 24 Jun 1998 17:27:17 GMT

>Number:         2495
>Category:       os-windows
>Synopsis:       #! syntax fails because filename of script (which contains spaces) is
not quoted
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Jun 24 10:30:02 PDT 1998
>Last-Modified:
>Originator:     harbaugh@ncifcrf.gov
>Organization:
apache
>Release:        1.3.0
>Environment:
Windows 95 OSR2 / pre-built binary Apache
>Description:
After verifying that Apache worked by installing and accessing some
other cgi executables I had,  I attempted to use the #! syntax to run
a perl script in the standard cgi-bin directory.  On my PC, this directory
is D:\Program Files\Apache Group\Apache\cgi-bin.

When I got the "Internal Server Error" response, I looked at my ScriptLog
file and found the following:

%% [Wed Jun 24 08:40:31 1998] GET /cgi-bin/hellopbang.pl HTTP/1.0
%% 500 d:/program files/apache group/apache/cgi-bin/hellopbang.pl
%request
Connection: Keep-Alive
User-Agent: Mozilla/4.04 [en] (Win95; U)
Host: boonies.ncifcrf.gov
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
%response
%stderr
Can't open perl script "d:/program": No such file or directory

The above is an error message from PERL.EXE, indicating it is trying to execute
"d:/program" (truncating the real file path at the first space) rather than
"D:\Program Files\Apache Group\Apache\cgi-bin\hellopbang.pl".  I appears that
the path will have to be quoted just as if it were an argument passed on
the command line of a DOS shell.

Also, since the above is a message from the perl interpreter, I am unsure
whether it will understand the use of "/" in place of "\", even if it does
receive the whole path.

Thank you for your time.
>How-To-Repeat:
Make sure the path to the default cgi-bin directory contains spaces.
Create a script hellopbang.pl:

#!D:\PERL\BIN\PERL.EXE
$|=1;
print "Content-type: text/html\n\n";
print "<h1>Hello!</h1>\n";
1;

and place it in the cgi-bin directory, substituting the correct location
of your perl executable.

Set ScriptLog in httpd.conf
>Fix:
I don't know how the arguments are passed to the program listed
on the #! line, but some how they have to be quoted.

I really like this feature, (it works if the path does not contain spaces),
so it would be very nice if this problem were fixed.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]




Mime
View raw message