httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: [users@httpd] Unexpected argv[0] passed to CGI programs
Date Thu, 05 Sep 2002 22:52:20 GMT

I seem to think that I fixed this a long time ago.  Okay, I found it in
CVS.  Apache 1.3 used absolute paths for everything except for
SuExec.  Until 2.0.40, Apache 2.0 used relative paths for
everything.  Are you sure that 1.3 used to use relative paths?  I
double-checked the code, and I had a user telling me that 2.0 wasn't
working like 1.3 (which I verified).  Which version of 1.3?

Also, patches that are sent to this list will generally not be applied,
because most developers aren't watching this list closely.  Patches should
be sent to dev@httpd.apache.org.

Ryan

On Thu, 5 Sep 2002, Pierre Barbier wrote:

> Testing our CGI programs under Apache 2.0.40, we noticed that the value
> received by a CGI program as argv[0] is the full path to the executable, not
> just the file name as it used to be in 1.3.
> Is this a bug (at least an omission, since the CGI spec doens't seem to
> cover this), or a feature?
> Is there a configuration option to modify that behavior (after looking at
> the source code, I don't think so)?
> 
> If it's a bug, here is a patch that seems to fix it:
> 
> diff -ruN httpd-2.0.40/modules/generators/mod_cgi.c
> httpd-2.0.40p/modules/generators/mod_cgi.c
> --- httpd-2.0.40/modules/generators/mod_cgi.c   Tue Jul 30 11:18:03 2002
> +++ httpd-2.0.40p/modules/generators/mod_cgi.c  Thu Sep  5 10:01:19 2002
> @@ -540,7 +540,7 @@
>          numwords = APACHE_ARG_MAX - 1;    /* Truncate args to prevent
> overrun */
>      }
>      *argv = apr_palloc(p, (numwords + 2) * sizeof(char *));
> -    (*argv)[0] = *cmd;
> +    (*argv)[0] = apr_filename_of_pathname(*cmd);
>      for (x = 1, idx = 1; x < numwords; x++) {
>          w = ap_getword_nulls(p, &args, '+');
>          ap_unescape_url(w);
> 
> Any feedback would be welcome!
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

-- 

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
550 Jean St
Oakland CA 94610
-------------------------------------------------------------------------------


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message