httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: BUG in util_script.c (fwd)
Date Mon, 29 Jul 1996 22:37:30 GMT
On Mon, 29 Jul 1996, Ben Laurie wrote:

> > > Well, one has to agree, there is almost certainly a bug somewhere. But where?
> > 
> > One does have to agree, and the source of the bug is simple:
> > 
> > The path info of the URL and the filename are assumed to be the same.
> > However, in this case (to use his example) the path info the URL is
> > /test-cgi, but the path info of the filename is /ivan/test-cgi. r->info is
> > set to /ivan/test-cgi, which is 13 characters long, r->uri is shorted by
> > 13 characters, to /iva.
> > 
> > However, I can't seem to think of a fix. At least not offhand.
> 
> In other words, you don't know where the bug is. Join the gang.

Here's a fix. Can't think of the best way to code it, though:

1. Take r->path_info. Match it to the end of r->uri.
2. Find the point at which r->path_info and r->uri diverge (or
   r->path_info runs out of characters). Make the matching part of
   r->uri PATH_INFO, and the rest SCRIPT_NAME.

This should fix his problem. In his setup, r->path_info is
"/ivan/test-cgi", which matches only the last 9 characters of
"/ivan-cgi/test-cgi". So PATH_INFO becomes "/test-cgi" and SCRIPT_NAME
becomes "/ivan-cgi".

Sounds like it should work to me, and shouldn't break anything existing.

-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Mime
View raw message