httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Bug in 0.8.10 and 0.8.8 : multiple //// with cgi-scripts (fwd)
Date Sun, 20 Aug 1995 14:06:50 GMT
> > 
> > <IMG 
> > SRC="cgi-bin/nph-count?width=5&link=http://cal003109.student.utwente.nl/ind
> > ex.html">
> > 
> > if I call the page with http://cal003109.student.utwente.nl////tmp.html the 
> > counter shows up in the error_log:
> > 
> > [Sun Aug 20 11:18:47 1995] access to /WWW/httpdocs////cgi-bin failed for 
> > cal003105.student.utwente.nl, reason: File does not exist
> 
  I'm not sure what Apache is outputting, guess I should go and look, but this
  looks like a Linux bug anyway. The OS should collapse multiple / in paths
  and find the file even if Apache is leaving multiple / in them.

It's not an OS problem --- the bug is that we get a request for
the URI '///cgi-bin/...' (because of the relative link in the original
document, '<img src="cgi-bin/...">', which was requested as '///tmp.html',
or something like that), and 0.8.x isn't matching a request for ///cgi-bin
with an alias for /cgi-bin.

(Why?  Well, way back when we decided that smashing multiple slashes in
PATH_INFO was a bug.  However, you don't know where PATH_INFO starts until
you've translated the URI, so you've got to preserve them through Alias
translation at least --- and that module does all of its comparisons via
strcmp()).

At any rate, one workaround for this particular guy, at least, is to
add the initial '/' himself --- <img src="/cgi-bin/...">, thereby gaining
for himself a document which will work somewhere other than DocumentRoot...

rst

Mime
View raw message