pquerna 2004/07/09 19:25:56
Modified: . CHANGES
docs/manual/mod mod_autoindex.xml
modules/generators mod_autoindex.c
Log:
Add ShowForbidden to IndexOptions to list files
that are not shown because the subrequest returned 401 or 403.
PR: 10575
Revision Changes Path
1.1532 +4 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1531
retrieving revision 1.1532
diff -u -r1.1531 -r1.1532
--- CHANGES 9 Jul 2004 21:29:33 -0000 1.1531
+++ CHANGES 10 Jul 2004 02:25:55 -0000 1.1532
@@ -2,6 +2,10 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) mod_autoindex: Add ShowForbidden to IndexOptions to list files
+ that are not shown because the subrequest returned 401 or 403.
+ PR 10575. [Paul Querna]
+
*) util_ldap: Switched the lock types on the shared memory cache
from thread reader/writer locks to global mutexes in order to
provide cross process cache protection. [Brad Nicholes]
1.25 +7 -1 httpd-2.0/docs/manual/mod/mod_autoindex.xml
Index: mod_autoindex.xml
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_autoindex.xml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- mod_autoindex.xml 17 Apr 2004 10:49:22 -0000 1.24
+++ mod_autoindex.xml 10 Jul 2004 02:25:56 -0000 1.25
@@ -652,6 +652,12 @@
then httpd will read the document for the value of the
<code>title</code> element. This is CPU and disk intensive.</dd>
+ <dt><a name="indexoptions.showforbidden"
+ id="indexoptions.showforbidden">ShowForbidden</a></dt>
+
+ <dd>If specified, Apache will show files normally hidden because
+ the subrequest returned HTTP_UNAUTHORIZED or HTTP_FORBIDDEN</dd>
+
<dt><a name="indexoptions.suppresscolumnsorting"
id="indexoptions.suppresscolumnsorting"
>SuppressColumnSorting</a></dt>
1.134 +12 -1 httpd-2.0/modules/generators/mod_autoindex.c
Index: mod_autoindex.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_autoindex.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- mod_autoindex.c 10 Mar 2004 20:51:10 -0000 1.133
+++ mod_autoindex.c 10 Jul 2004 02:25:56 -0000 1.134
@@ -69,6 +69,7 @@
#define IGNORE_CLIENT (1 << 15)
#define IGNORE_CASE (1 << 16)
#define EMIT_XHTML (1 << 17)
+#define SHOW_FORBIDDEN (1 << 18)
#define K_NOADJUST 0
#define K_ADJUST 1
@@ -383,6 +384,9 @@
else if (!strcasecmp(w, "XHTML")) {
option = EMIT_XHTML;
}
+ else if (!strcasecmp(w, "ShowForbidden")) {
+ option = SHOW_FORBIDDEN;
+ }
else if (!strcasecmp(w, "None")) {
if (action != '\0') {
return "Cannot combine '+' or '-' with 'None' keyword";
@@ -1267,6 +1271,7 @@
{
request_rec *rr;
struct ent *p;
+ int show_forbidden = 0;
/* Dot is ignored, Parent is handled by make_parent_entry() */
if ((dirent->name[0] == '.') && (!dirent->name[1]
@@ -1297,9 +1302,15 @@
return (NULL);
}
+ if((autoindex_opts & SHOW_FORBIDDEN)
+ && (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN))
{
+ show_forbidden = 1;
+ }
+
if ((rr->finfo.filetype != APR_DIR && rr->finfo.filetype != APR_REG)
|| !(rr->status == OK || ap_is_HTTP_SUCCESS(rr->status)
- || ap_is_HTTP_REDIRECT(rr->status))) {
+ || ap_is_HTTP_REDIRECT(rr->status)
+ || show_forbidden == 1)) {
ap_destroy_sub_req(rr);
return (NULL);
}
|