Bug 39944

Summary: Wrong/Bad filename in ErrorLog when trying to access files in non existing directories
Product: Apache httpd-2 Reporter: Erika Mustermann <user23ksws>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal Keywords: FixedInTrunk
Priority: P2    
Version: 2.2.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Proposed patch

Description Erika Mustermann 2006-07-02 13:04:57 UTC
When you are trying to access a non-existent file in a non-existent directory
apache will notice this in the specified ErrorLog in a very bad way:

It only shows 'File does not exist: <DOCROOT>/<FIRST-DIR-WHICH-DOES-NOT-EXIST>'

In apache 1.3.X you see the full path of the non-existent file!

In the code (server/core.c, Line 3592) I found:
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "File does not exist: %s (for URI %s) rest: %s",

while in Line 3610 there is:
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "File does not exist: %s",
                          apr_pstrcat(r->pool, r->filename, r->path_info, NULL));
The first code doesn't show the whole filename while the second does!

Whow to reproduce:

./configure --prefix=/tmp/httpd
make install
wget http://localhost/this/dirs/do/not/exists.html
tail -1 /tmp/httpd/logs/error_log


[Sun Jul 02 14:58:22 2006] [error] [client] File does not exist:
Comment 1 Christophe JAILLET 2012-10-02 20:11:20 UTC
Confirmed on trunk (2.5).

You have to set LogLevel to info in order to reproduce it.
Comment 2 Christophe JAILLET 2012-10-02 20:14:16 UTC
Created attachment 29439 [details]
Proposed patch
Comment 3 Christophe JAILLET 2013-02-04 22:46:56 UTC
Fixed in trunk.

Comment 4 Christophe JAILLET 2013-02-06 17:20:29 UTC
Backported in 2.4.x