httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31126] - Apache tries to access files as folders if Reiser4 FS is used
Date Thu, 09 Sep 2004 04:21:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31126>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31126

Apache tries to access files as folders if Reiser4 FS is used





------- Additional Comments From ricilake@speedy.com.pe  2004-09-09 04:21 -------
While the behaviour of ReiserFS is questionable, it does not seem that Apache is doing the
right thing either.

Specifically, ap_parse_htaccess is being called under some circumstances even when the uri
identifies a specific file, rather than a directory. I believe the offending code is at line
923 of
server/request.c, following the comment:

            /* First optimization;
             * If...we knew r->filename was a file, and
             * if...we have strict (case-sensitive) filenames, or
             *      we know the canonical_filename matches to _this_ name, and
             * if...we have allowed symlinks
             * skip the lstat and dummy up an APR_DIR value for thisinfo.
             */

The problem is that the dummy APR_DIR value will be inserted even if the last segment is a
regular file; in the following iteration of the do loop, ap_parse_htaccess will attempt to
append "/.htaccess" (or whatever) onto the filename confident that it will be able to correctly
identify the resulting error. Unfortunately, Reiser4 appears to return EACCES instead of ENOENT
or ENOTDIR in this particular case. I don't actually have Reiser to play with, but I checked
the
behaviour by placing the following logging statement in ap_parse_htaccess, at the point
where it has failed to open the .htaccess file:

            ap_log_rerror(APLOG_MARK, APLOG_WARNING, status, r,
                          "pcfg_openfile tried %s and failed", filename);


With -FollowSymLinks (thereby disabling the optimization), I got the following log trace:
httpd 2.0.50
docroot: /usr/local/www/perltest
request: //freeb/perlest/foo/test.html
(Note that the file exists and there are no .htaccess files)

[Wed Sep 08 22:01:08 2004] [warn] [client 192.168.1.65]
   (2)No such file or directory: pcfg_openfile tried /usr/local/www/perltest/.htaccess and
failed
[Wed Sep 08 22:01:08 2004] [warn] [client 192.168.1.65]
   (2)No such file or directory: pcfg_openfile tried /usr/local/www/perltest/foo/.htaccess
and failed

Enabling FollowSymLinks and using exactly the same request reveals that the loop runs once
too often: 
(and that the Ext3 filesystem return ENOTDIR for this error)

[Wed Sep 08 22:03:08 2004] [warn] [client 192.168.1.65]
   (2)No such file or directory: pcfg_openfile tried /usr/local/www/perltest/.htaccess and
failed
[Wed Sep 08 22:03:08 2004] [warn] [client 192.168.1.65]
   (2)No such file or directory: pcfg_openfile tried /usr/local/www/perltest/foo/.htaccess
and failed
[Wed Sep 08 22:03:08 2004] [warn] [client 192.168.1.65]
   (20)Not a directory: pcfg_openfile tried /usr/local/www/perltest/foo/test.html/.htaccess
and failed

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message