httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Pulsifer" <pulsif...@comcast.net>
Subject httpd attempts to open file.html/.htaccess (is this a bug?)
Date Mon, 11 Jun 2007 13:01:33 GMT
Summary:

When processing a "GET /.../file.html", Apache httpd briefly treats
file.html as a directory and attempts to open
"docroot/.../file.html/.htaccess".  The os returns ENOTDIR, and then
processing of the request continues.

There would seem to be no reason for httpd to attempt to open
file.html/.htaccess, especially since it has already done a stat on
file.html and knows that it is a file, not a directory.

Does anyone else see the same behavior?  Is this a bug?


Configuration: Apache httpd v 2.2.4 running on a default installation of
CentOS-5 (ext3 filesystem).  Tested with stock configuration distributed
with CentOS-5, as well as a stock installation compiled from the source.

Only change to http.conf is:
"AllowOverride None" changed to "AllowOverride All"

DocumentRoot is "/var/www/html", and I created an html file at
/var/www/html/dir/subdir/file.html

Command is "curl -i http://localhost/dir/subdir/file.html"

Result of "strace -f -e trace=file /usr/sbin/httpd":

[pid 24550] stat64("/var/www/html/dir/subdir/file.html",
{st_mode=S_IFREG|0644, st_size=48, ...}) = 0

[pid 24550] open("/var/www/html/.htaccess", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)

[pid 24550] open("/var/www/html/dir/.htaccess", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)

[pid 24550] open("/var/www/html/dir/subdir/.htaccess", O_RDONLY|O_LARGEFILE)
= -1 ENOENT (No such file or directory)

[pid 24550] open("/var/www/html/dir/subdir/file.html/.htaccess",
O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory)

[pid 24550] open("/var/www/html/dir/subdir/file.html", O_RDONLY|O_LARGEFILE)
= 18


Note the open("/var/www/html/dir/subdir/file.html/.htaccess"), which
returned ENOENT.


Mime
View raw message