You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Sutton <pa...@ukweb.com> on 1997/10/21 13:20:12 UTC

[BUG] NT version fails for CGI with ?arg

There are two PRs about this. Any access to a CGI with a query string
which does not contain either + or = fails (crashes Apache).

This patch fixes it. The arguments to create_argv() seemed to be wrong.
Since NT never uses suexec, there shouldn't be an initial path argument,
and the args arguments were in the wrong place. So I've moved the path 
argument to the "argv0" argument, and the "args" argument to correct
place.

Was there any reason why the args to create_argv() were in a different
order on NT from Unix? 

//pcs

Index: util_script.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/util_script.c,v
retrieving revision 1.79
diff -u -r1.79 util_script.c
--- util_script.c	1997/10/20 12:08:59	1.79
+++ util_script.c	1997/10/21 10:39:40
@@ -755,13 +755,13 @@
 	else {
 	    if (is_exe || is_binary) {
 		pid = spawnve(_P_NOWAIT, r->filename,
-			      create_argv(r->pool, argv0, NULL, NULL, r->args,
-					  (void *) NULL), env);
+			      create_argv(r->pool, NULL, NULL, NULL, argv0, 
+					  r->args), env);
 	    }
 	    else if (is_script) {
 		ap_assert(0);
 		pid = spawnve(_P_NOWAIT, interpreter + 2,
-			      create_argv(r->pool, interpreter + 2, NULL, NULL,
+			      create_argv(r->pool, NULL, NULL, NULL,
 					  r->filename, r->args), env);
 	    }
 	    else {



Re: [BUG] NT version fails for CGI with ?arg

Posted by Ben Laurie <be...@algroup.co.uk>.
Paul Sutton wrote:
> 
> There are two PRs about this. Any access to a CGI with a query string
> which does not contain either + or = fails (crashes Apache).
> 
> This patch fixes it. The arguments to create_argv() seemed to be wrong.
> Since NT never uses suexec, there shouldn't be an initial path argument,
> and the args arguments were in the wrong place. So I've moved the path
> argument to the "argv0" argument, and the "args" argument to correct
> place.

The ap_assert(0) doesn't help any, either.

> Was there any reason why the args to create_argv() were in a different
> order on NT from Unix?

Dunno.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache