Bug 39944 - Wrong/Bad filename in ErrorLog when trying to access files in non existing directories
Wrong/Bad filename in ErrorLog when trying to access files in non existing di...
Status: RESOLVED FIXED
Product: Apache httpd-2
Classification: Unclassified
Component: Core
2.2.2
All All
: P2 normal (vote)
: ---
Assigned To: Apache HTTPD Bugs Mailing List
: FixedInTrunk
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-07-02 13:04 UTC by Erika Mustermann
Modified: 2013-02-06 17:20 UTC (History)
0 users



Attachments
Proposed patch (628 bytes, patch)
2012-10-02 20:14 UTC, Christophe JAILLET
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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",
r->filename)

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
make install
/tmp/httpd/bin/httpd
wget http://localhost/this/dirs/do/not/exists.html
tail -1 /tmp/httpd/logs/error_log

gives:

[Sun Jul 02 14:58:22 2006] [error] [client 127.0.0.1] File does not exist:
/tmp/httpd/htdocs/this
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.

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

r1443076