Search the web
Sign In
New User? Sign Up
new-httpd
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
403's not getting logged?   Message List  
Reply | Forward Message #44073 of 56488 |
Re: 403's not getting logged?

Joshua Slive wrote:
> On Fri, 9 May 2003, Rich Bowen wrote:
>
>
>>I'm experiencing a should-not-happen condition in apache 1.3.27, and
>>wondered if anyone else could verify for me. In the case of a 403
>>error caused by incorrect directory permissions, there is no error
>>log entry. If the file is unreadable, the 403 goes in the error log.
>>But if the directory has bogus permissions, there's no entry.
>>This is on 1.3.27 I've tested this on 2 servers so far, and it seems
>>consistent.
>
>
> Yes, this is a very longstanding and very irritating omission. I don't
> think I would be exagerating if I said this was the source of hundreds of
> confused queries to the users mailing list and newsgroup.
>
> I browsed through the default handler a while back trying to figure out
> where this error was getting dropped, but I ran out of time and never got
> back to it. Someone who knows the code better could probably find it
> faster.

hurray for truss!

/1: -> directory_walk(0x15a170, 0x0, 0x0, 0x0)
/1: -> ap_os_is_path_absolute(0x15a938, 0x0, 0x0, 0x0)
/1: <- ap_os_is_path_absolute() = 1
/1: -> get_path_info(0x15a170, 0x0, 0x0, 0x0)
stat("/export/home/trawick/apache13inst/htdocs/test/gobble.html",
0x0015A238) Err#13 EACCES
/1: <- get_path_info() = 403
/1: <- directory_walk() = 403
/1: -> ap_die(0x193, 0x15a170, 0x0, 0x0)

A check was added for eaccess with r1.40 of src/main/http_request.c:

The below patch makes the error message a bit more standard and doesn't
print it if the reason for stat failing was EACCES. Should go in before
the beta goes out.
Reviewed by: Randy Terbush
Submitted by: Marc Slemko

Here is how to back it out:

diff -u -r1.168 http_request.c
--- src/main/http_request.c 3 Feb 2003 17:13:23 -0000 1.168
+++ src/main/http_request.c 9 May 2003 18:01:06 -0000
@@ -288,7 +288,7 @@
}
else {
#if defined(EACCES)
- if (errno != EACCES)
+/* if (errno != EACCES) */
#endif
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"access to %s failed", r->uri);

Here is some text from dev@httpd around that time, showing justification
for that change:

On Wed, 15 Jan 1997 willday@... wrote:

> Submitter: willday@...
> Operating system: Solaris 2.x, version:
> Version of Apache Used: 1.1.3
> Extra Modules used:
> URL exhibiting problem: agent_log_module referer_log_module
config_log_module status_module
>
> Symptoms:
> --
> If a directory has insufficient perms (700), apache will report in
the error_log that "stat() returned u\
nexpected error[13]" for _each_ possible index file in
srm.con:DirectoryIndex. Errno 13, according to /us\
r/include/sys/errno.h, is EACCES "Permissio
n denied". This tends to fill up the error_log unnecessarily, and more
important error messages get lost \
in the noise. I would imagine the code should check to see if the
errno=EACCES, and just return FORBIDDEN\
, without logging an error.

Anybody want to see if backing out the change still results in multiple
error log entries for a directory listing?




Fri May 9, 2003 6:06 pm

trawick@...
Send Email Send Email

Forward
Message #44073 of 56488 |
Expand Messages Author Sort by Date

I'm experiencing a should-not-happen condition in apache 1.3.27, and wondered if anyone else could verify for me. In the case of a 403 error caused by...
Rich Bowen
rbowen@...
Send Email
May 9, 2003
5:36 pm

... Yes, this is a very longstanding and very irritating omission. I don't think I would be exagerating if I said this was the source of hundreds of confused...
Joshua Slive
joshua@...
Send Email
May 9, 2003
5:42 pm

... hurray for truss! /1: -> directory_walk(0x15a170, 0x0, 0x0, 0x0) /1: -> ap_os_is_path_absolute(0x15a938, 0x0, 0x0,...
Jeff Trawick
trawick@...
Send Email
May 9, 2003
6:05 pm

... Good quick sluthing. ... Having one error for each item in the DirectoryIndex (ie, one for index.html, index.htm, and index.php) seems like a small penalty...
Joshua Slive
joshua@...
Send Email
May 9, 2003
6:23 pm

... Yes. I am also +1 on this, and have numerous 1.3 installations on which I can test it. -- Rich Bowen Apache - mod_perl - Perl - CGI ...
Rich Bowen
rbowen@...
Send Email
May 9, 2003
6:53 pm

... With LogLevel set at debug, I'm just getting: [Fri May 9 15:33:11 2003] [error] [client 127.0.0.1] (13)Permission denied: access to /index.html failed No...
Rich Bowen
rbowen@...
Send Email
May 9, 2003
7:33 pm

... What does your DirectoryIndex directive look like? Try something like DirectoryIndex a b c d e ... As long as we are taking all this trouble, we might as...
Joshua Slive
joshua@...
Send Email
May 9, 2003
7:36 pm

... Ah, yes, I get: [Fri May 9 16:10:43 2003] [error] [client 127.0.0.1] (13)Permission denied: access to /index.html failed [Fri May 9 16:10:43 2003]...
Rich Bowen
rbowen@...
Send Email
May 9, 2003
8:08 pm

... OK. Here is a tested patch, but I'll wait for a couple explicit +1s before committing. I'm not sure if perhaps the message should say "... because search ...
Joshua Slive
joshua@...
Send Email
May 9, 2003
8:35 pm

... +1 from me (tested) ... the message is plenty long already...
Jeff Trawick
trawick@...
Send Email
May 9, 2003
9:22 pm

... +1 ... That would not only help the newbies, it would help the "tech support" people who are faced with the beligerent newbies who insist that the ...
Rich Bowen
rbowen@...
Send Email
May 11, 2003
12:28 am

... The # of entries would equal the # of values for DirectoryIndex. At least, that's what the original bug handled. -- ...
Jim Jagielski
jim@...
Send Email
May 9, 2003
7:46 pm

... That's as designed, IIRC, though I cannot recall *why* we did it that way... -- ===========================================================================...
Jim Jagielski
jim@...
Send Email
May 9, 2003
6:06 pm

... Then I would suggest that it is a bad design, and leads to a lot of user confusion. Unless there's a really good reason for this, it would be nice to have...
Rich Bowen
rbowen@...
Send Email
May 9, 2003
6:34 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help