httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Douglass <>
Subject Re: [2.0] lstat's in spite of AllowOverride None
Date Fri, 09 Nov 2001 20:11:42 GMT

> > As FirstBill suggests, there are other means for caching the (l)stat
> > results, at least for the request duration, which need to be deployed.  But
> > dropping the path_info walk-backwards logic was step one.  Any optimization
> > patches are entertianed to speed up the server, if we don't lose stability.
> Caching the lstat() results should help, but reducing to a single stat() as I 
> suggest would seem better still?

I'd be weary of caching the lstat() information for more than the current
connection; you don't want someone to abuse that cache by creating a
symlink AFTER letting apache cache the information.

Anyone think about using resolvepath() as an initial check?  resolvepath()
is a single system call to take a path to a file and convert it to the
resultant path after following all symlinks.  Thus you could have a single
call to resolvepath() and strcmp() to see if there were any symlinks in
the path--if there were then you either "deny" it if symlinks are not
allowed at all; or you proceed with the lstat() scheme otherwise.

This would seem to circumvent alot of lstat() calls on the (hopefully)
normal case that there are no symlinks involved anywhere. :)

Michael Douglass
Chief System Engineer
Texas Networking, Inc.  (512-794-7123)

View raw message