The following reply was made to PR mod_cgi/1621; it has been noted by GNATS.
From: Marc Slemko <[EMAIL PROTECTED]> To: Mark Blythe <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: mod_cgi/1621: CGI scripts can have a #! that is another script. Date: Sun, 4 Jan 1998 00:08:15 -0700 (MST) On 4 Jan 1998, Mark Blythe wrote: > >Description: > It appears that apache can't run a CGI script which has another script as > its interpreter, as specified in the shebang (#!) line. They must point > to a true executable. I'm fairly certain this hasn't always been the case. Apache really doesn't have too much to do with this on Unix. The shell does it all... > >How-To-Repeat: > Try this: > > File: /usr/local/bin/interpret.sh > #!/usr/bin/sh > echo "Content-type: text/plain" > echo > cat $1 > > File: /usr/local/etc/httpd/test.cgi > #!/usr/local/bin/interpret.sh > This is a test CGI > It worked! > > If test.cgi is run from the command line, it works fine. However, if run > as a script through Apache, it errors with an "Exec format error (errno = 8)" > in the error log. If you run test.cgi from within /bin/sh on the command line does it work?
