httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1147339 - in /httpd/httpd/trunk/modules: generators/mod_autoindex.c mappers/mod_dir.c
Date Fri, 15 Jul 2011 22:32:43 GMT
Author: covener
Date: Fri Jul 15 22:32:42 2011
New Revision: 1147339

URL: http://svn.apache.org/viewvc?rev=1147339&view=rev
Log:
improve (but preserve searchable parts of) the error message when Options 
-Indexes is about to trigger a 403 in mod_autoindex, with a pointer
to mod_dir about how the DirectoryIndex might have been the real culprit.


Modified:
    httpd/httpd/trunk/modules/generators/mod_autoindex.c
    httpd/httpd/trunk/modules/mappers/mod_dir.c

Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1147339&r1=1147338&r2=1147339&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Fri Jul 15 22:32:42 2011
@@ -2308,9 +2308,14 @@ static int handle_autoindex(request_rec 
         return index_directory(r, d);
     }
     else {
+        const char *index_names = apr_table_get(r->notes, "dir-index-names");
+
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
-                      "Directory index forbidden by "
-                      "Options directive: %s", r->filename);
+                      "Cannot serve directory %s: No matching DirectoryIndex (%s) found,
and "
+                      "server-generated directory index forbidden by "
+                      "Options directive", 
+                       r->filename,
+                       index_names ? index_names : "none");
         return HTTP_FORBIDDEN;
     }
 }

Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=1147339&r1=1147338&r2=1147339&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_dir.c Fri Jul 15 22:32:42 2011
@@ -346,6 +346,12 @@ static int fixup_dir(request_rec *r)
         return error_notfound;
     }
 
+    /* record what we tried, mostly for the benefit of mod_autoindex */
+    apr_table_set(r->notes, "dir-index-names", 
+                  d->index_names ? 
+                  apr_array_pstrcat(r->pool, d->index_names, ','): 
+                  AP_DEFAULT_INDEX);
+
     /* nothing for us to do, pass on through */
     return DECLINED;
 }



Mime
View raw message