httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: cvs commit: httpd-2.0/modules/generators mod_cgi.c mod_cgid.c
Date Mon, 30 Jul 2001 17:11:57 GMT
From: "Bill Stoddard" <bill@wstoddard.com>
Sent: Monday, July 30, 2001 11:17 AM


> > It's the responsibility of
> > dir walk/file walk to resolve symlinks to their target, so
> > we shouldn't have to test APR_LNK.
> 
> Cool! Didn't recognise this.

That is my personal opinion.  My directory_walk rework basically _always_
performs a (required) lstat - first.  If that lstat returns a link, either 
the stat is retrieved and owners are compared, or the request is denied.  
If it returns a file/directory, then it can go on it's merry way, and doesn't 
care that we didn't do an actual stat.

There is a secondary issue.  Any apr_dir_open/read should retrieve lstat's
first, so we can decide how to resolve them.  It takes the onus off of the
ap_sub_request_lookup_dirent() to go back and check for a symlink.  If we
pass ap_sub_request_lookup_dirent() a specific file, it should be from lstat(),
never stat().  Of course ap_sub_request_lookup_file() has to go through the
entire set of gyrations, but that's why I created the optimized case :)

I'll dig out the directory_walk patch and post it again this early this week
(this time, as a patch).  Note we _really_ need the caching optimizations before 
we can consider it production quality, but I'd like to simply get it committed
and drop the back-asswards get_file_info pre-step.

Bill


Mime
View raw message