httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject RE: PR6880 CGI applications always fail (Windows)
Date Fri, 15 Dec 2000 06:45:09 GMT
Now that I understand this to be a 2.0a8 issue (sorry, my brain
is on another page...)

We likely have the same 'missing console' problem anyway on 2.0,
one of my goals in the next week is to move forward the 1.3.14->15
changes for Win32 (many were already in 2.0, but the Win9x stuff
and 'keeping the console' were not.)  This is the pipes issue where
any app runing in a newly created console fails to close the pipes.

The other changes are also needed in 2.0 ... we need to 'right'
the slashes to backslashes before exec'ing anything on win32.
LoadModule (and anything related) has kiniptions over slashes
(it's in the platform sdk docs under LoadModule/LoadModuleEx.)
Seems like a kernel bug to me.

Finally, we need to move the short path fix for execing cgi's that
are based on registry "command %1" syntax and shebang scripts.
The long path (containing spaces and other evils) is only good on
registry commands in the syntax "command "%1"", and we slightly
adapted the shebang line processing to accept #!foo "%1" as well.
(OTOH, maybe I didn't, that might have worked from the getgo.)
This was done by passing the command without % expansions back to
the getscriptinterpreter function, rather than stripping off the
%1 when we first encountered it.

But you are right, the change to the win32 path was a very bad thing.
Feel free to apply, I'll be reviewing lots of this code soonish.

Bill

> -----Original Message-----
> From: Allan Edwards [mailto:ake@meepzor.com]
> Sent: Thursday, December 14, 2000 6:24 PM
> To: new-httpd@apache.org
> Subject: RE: PR6880 CGI applications always fail (Windows)
> 
> 
> > Please, let me look carefully at this in about 3 hours.
> > Have to run at this moment... but there was reasonable
> > new logic in cgi (quoted paths for "%1" args, unquoted
> > 'short paths' for %1 and 16 bitters.)
> > 
> > I'll look asap
> 
> No problem, I'm heading out myself. I appreciate you
> taking a look at it since I know the cgi path stuff
> for Windows is a little tricky.
> 
> BTW the previous patch was bad, this is the correct
> one...
> 
> Cheers, Allan
> 
> Index: modules/generators/mod_cgi.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v
> retrieving revision 1.72
> diff -u -d -b -r1.72 mod_cgi.c
> --- modules/generators/mod_cgi.c	2000/11/27 22:30:34	1.72
> +++ modules/generators/mod_cgi.c	2000/12/15 00:13:29
> @@ -477,7 +477,7 @@
>      /*
>       * Build the command string to pass to 
> ap_os_create_privileged_process()
>       */
> -    quoted_filename = apr_pstrcat(p, "\"", argv0, "\"", NULL);
> +    quoted_filename = apr_pstrcat(p, "\"", r->filename, "\"", NULL);
>      if (interpreter && *interpreter) {
>          if (arguments && *arguments)
>              *cmd = apr_pstrcat(p, interpreter, " ", 
> quoted_filename, " ", 
> @@ -492,7 +492,7 @@
>          *cmd = apr_pstrcat(p, quoted_filename, NULL);
>      }
>  #else
> -    *cmd = argv0;
> +    *cmd = apr_pstrcat(p, r->filename, NULL);
>  #endif
>      return APR_SUCCESS;
>  }
> Index: srclib/apr/threadproc/win32/proc.c
> ===================================================================
> RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
> retrieving revision 1.39
> diff -u -d -b -r1.39 proc.c
> --- srclib/apr/threadproc/win32/proc.c	2000/11/26 
> 02:03:12	1.39
> +++ srclib/apr/threadproc/win32/proc.c	2000/12/15 00:13:37
> @@ -282,7 +282,7 @@
>              ptr++;
>          }
>  
> -        if (*ptr == '\\' || *++ptr == ':') {
> +        if (*ptr == '\\' || *ptr == '/' || *++ptr == ':') {
>              cmdline = apr_pstrdup(cont, progname);
>          }
>          else if (attr->currdir == NULL) {
> 

Mime
View raw message