]> granicus.if.org Git - apache/commitdiff
Add ShowForbidden to IndexOptions to list files
authorPaul Querna <pquerna@apache.org>
Sat, 10 Jul 2004 02:25:56 +0000 (02:25 +0000)
committerPaul Querna <pquerna@apache.org>
Sat, 10 Jul 2004 02:25:56 +0000 (02:25 +0000)
that are not shown because the subrequest returned 401 or 403.

PR: 10575

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104212 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_autoindex.xml
modules/generators/mod_autoindex.c

diff --git a/CHANGES b/CHANGES
index 5f093ae5be7a428bec3e04e6945f412f4d827766..c0b5b0f64587dc9c89426866236494bdc4d83f09 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [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]
index 54e1714a7e8d194194307364a39c24e80216ee77..81abb98e3a178b87e6263571265196f5e0e5fcbd 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
-<!-- $Revision: 1.24 $ -->
+<!-- $Revision: 1.25 $ -->
 
 <!--
  Copyright 2002-2004 The Apache Software Foundation
@@ -652,6 +652,12 @@ indexing</description>
       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>
index 50854a4dae9fbee4b5dbeff348ecfcd51f86761f..2a34fa887a58afa47ab9e35cfa4cc84e67cfae67 100644 (file)
@@ -69,6 +69,7 @@ module AP_MODULE_DECLARE_DATA autoindex_module;
 #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 @@ static const char *add_opts(cmd_parms *cmd, void *d, const char *optstr)
         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 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
 {
     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 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
         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);
     }