httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject printing r->filename for access denied errors
Date Fri, 16 Mar 2012 11:54:37 GMT
Seems like IRC users are often confused that permission denied errors
include the URI only and not the filesystem path.

(They're convinced it's failing because httpd is looking in the wrong
place for /index.html, or they think we forgot to add a documentroot,
or have no idea where /foo/bar/baz is supposed to be in the
filesystem)

Is there any harm in adding it?  This is the rv from a stat in the
directory walk.

Index: server/request.c
===================================================================
--- server/request.c	(revision 1299737)
+++ server/request.c	(working copy)
@@ -1094,9 +1094,9 @@
             }
             else if (APR_STATUS_IS_EACCES(rv)) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00035)
-                              "access to %s denied because search "
-                              "permissions are missing on a component "
-                              "of the path", r->uri);
+                              "access to %s (filesystem path '%s') denied "
+                              "because search permissions are missing on a "
+                              "component of the path", r->uri, r->filename);
                 return r->status = HTTP_FORBIDDEN;
             }
             else if ((rv != APR_SUCCESS && rv != APR_INCOMPLETE)
@@ -1105,7 +1105,8 @@
                  * rather than assume not found.
                  */
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00036)
-                              "access to %s failed", r->uri);
+                              "access to %s (filesystem path '%s') failed",
+                              r->uri, r->filename);
                 return r->status = HTTP_FORBIDDEN;
             }


-- 
Eric Covener
covener@gmail.com

Mime
View raw message