httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allan Edwards" <...@meepzor.com>
Subject PR6880 CGI applications always fail (Windows)
Date Fri, 15 Dec 2000 00:05:16 GMT
Does anyone know why, as part of the patch to 
enable suexec for cgi's (about 7 weeks ago), 
build_command_line() in mod_cgi was changed 
(in Windows only code)to use arg0 instead 
of r->filename? It broke exe cgi's on Windows.

If there isn't a good reason then this patch
will reverse that change and fix one other path
problem to get exe cgi's working again.

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/14 22:54:41
@@ -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 = r->filename;
 #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/14 22:54:49
@@ -282,7 +282,8 @@
             ptr++;
         }
 
-        if (*ptr == '\\' || *++ptr == ':') {
+        if (*ptr == '\\' || *ptr == '/' || *++ptr == ':') {
             cmdline = apr_pstrdup(cont, progname);
         }
         else if (attr->currdir == NULL) {


Mime
View raw message