httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject Re: known bugs
Date Fri, 25 Aug 1995 11:37:00 GMT
A while ago, rst wrote:
>   6.  design error: sub_req_lookup_simple() assumes that if
>       URL path /foo/baz corresponds to the file /a/b/c, then the
>       URL path /foo/baz/./wom (= /foo/wom) will correspond to /a/b/wom
>       This is incorrect if /foo/baz is an Alias, e.g.
>       DocumentRoot /wibble
>       Alias /foo/baz.shtml /a/b/c.shtml
>
>       #include "wom"
>       /foo/wom will be /wibble/foo/wom, not /a/b/wom
>
>Sigh... sub_req_lookup_simple() exists to avoid the considerable
>expense of a full access check in case you know you're looking up
>something in the same directory --- this is for includes, directory
>lists, and MultiViews.
>
>This could be "fixed" by just deleting the call to
>sub_req_lookup_simple from sub_req_lookup_virtual(), and making sure
>that mod_dir uses sub_req_lookup_file() (so that it actually gets the
>_simple() version --- for _file(), aliases don't matter and there is
>no bug).

The correct solution is to always do translate-name (rather than trying
to second-guess it), and then check to see if the real directories are the
same, and do optimisations in that case.

The only useful optimisation is to try avoid directory_walk() as that is the
only part which interacts with the OS (.htaccess and lstat), and hence is the
slowest.

 David.

Mime
View raw message