httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Pulsifer" <pulsif...@comcast.net>
Subject [users@httpd] httpd attempts to open file.html/.htaccess (is this a bug?)
Date Thu, 07 Jun 2007 15:59:59 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?

Details:

Configuration: Apache httpd v 2.2.4 running on CentOS-5.  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.

It is believed that this bug is somewhere in ap_directory_walk() in
server\request.c


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message