summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2011-07-15 22:32:42 +0000
committerEric Covener <covener@apache.org>2011-07-15 22:32:42 +0000
commitb1b5e91608e1e2c26538cc33687230d38ab1322b (patch)
treed87bf338be4171b36db49e029960a53f64676ac0
parent0b4285663ed19e803804e606467a168cf506698c (diff)
downloadhttpd-b1b5e91608e1e2c26538cc33687230d38ab1322b.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147339 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/generators/mod_autoindex.c9
-rw-r--r--modules/mappers/mod_dir.c6
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index fcb0a95ee6..3fe8257792 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -2308,9 +2308,14 @@ static int handle_autoindex(request_rec *r)
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;
}
}
diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c
index cb8e0346e8..c7ae2ae5c7 100644
--- a/modules/mappers/mod_dir.c
+++ b/modules/mappers/mod_dir.c
@@ -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;
}