]> granicus.if.org Git - apache/commitdiff
PR#24243: allow some control over how IndexIgnore'd files are merged.
authorEric Covener <covener@apache.org>
Sat, 4 Dec 2010 16:23:02 +0000 (16:23 +0000)
committerEric Covener <covener@apache.org>
Sat, 4 Dec 2010 16:23:02 +0000 (16:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042209 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/CHANGES b/CHANGES
index 213a8a2bc96ea59156e2b2b963b887aafff3cf6b..88e017b58aa5eee70eeef0f705c359b4034e3a86 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.10
 
+  *) mod_autoindex: add IndexIgnoreReset to reset the list of IndexIgnored
+     filenames in higher precedence configuration sections.  PR 24243.
+     [Eric Covener]
+
   *) mod_cgid: RLimit* directive support for mod_cgid.  PR 42135
      [Eric Covener]
 
index c71fa0aef98dc669b8fc6623713aaf56961c65c5..dbc285f58bd96b1dacff3f431f185b43a6211f63 100644 (file)
@@ -517,6 +517,37 @@ a directory</description>
 </usage>
 </directivesynopsis>
 
+<directivesynopsis>
+<name>IndexIgnoreReset</name>
+<description>Empties the list of files to hide when listing
+a directory</description>
+<syntax>IndexIgnoreReset ON|OFF</syntax>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context><context>.htaccess</context>
+</contextlist>
+<override>Indexes</override>
+
+<usage>
+    <p>The <directive>IndexIgnoreReset</directive> directive removes
+    any files ignored by <directive>IndexIgnore</directive> otherwise
+    inherited from other configuration sections. </p>
+
+    <example>
+      &lt;Directory /var/www&gt;
+      IndexIgnore *.bak .??* *~ *# HEADER* README* RCS CVS *,v *,t
+      &lt;/Directory&gt;
+      &lt;Directory /var/www/backups&gt;
+      IndexIgnoreReset ON
+      IndexIgnore .??* *# HEADER* README* RCS CVS *,v *,t
+      &lt;/Directory&gt;
+    </example>
+
+    <note type="warning"><p> Review the default configuration for a list of
+    patterns that you might want to explicitly ignore after using this 
+    directive.</p></note>
+</usage>
+</directivesynopsis>
+
 <directivesynopsis>
 <name>IndexOptions</name>
 <description>Various configuration settings for directory
index 7a44519032bd3ff6161b5a9c4e1b9df16104db5e..84166772672a7a57987142b237308e90affa0a81 100644 (file)
@@ -140,6 +140,7 @@ typedef struct autoindex_config_struct {
     apr_array_header_t *alt_list;
     apr_array_header_t *desc_list;
     apr_array_header_t *ign_list;
+    int ign_noinherit;
 
     char *ctype;
     char *charset;
@@ -582,6 +583,10 @@ static const command_rec autoindex_cmds[] =
                   "{Ascending,Descending} {Name,Size,Description,Date}"),
     AP_INIT_ITERATE("IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS,
                     "one or more file extensions"),
+    AP_INIT_FLAG("IndexIgnoreReset", ap_set_flag_slot, 
+                 (void *)APR_OFFSETOF(autoindex_config_rec, ign_noinherit), 
+                 DIR_CMD_PERMS,
+                 "Reset the inherited list of IndexIgnore filenames"),
     AP_INIT_ITERATE2("AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS,
                      "Descriptive text followed by one or more filenames"),
     AP_INIT_TAKE1("HeaderName", ap_set_string_slot,
@@ -653,9 +658,9 @@ static void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv)
     new->charset = add->charset ? add->charset : base->charset;
 
     new->alt_list = apr_array_append(p, add->alt_list, base->alt_list);
-    new->ign_list = apr_array_append(p, add->ign_list, base->ign_list);
     new->desc_list = apr_array_append(p, add->desc_list, base->desc_list);
     new->icon_list = apr_array_append(p, add->icon_list, base->icon_list);
+    new->ign_list = add->ign_noinherit ? add->ign_list : apr_array_append(p, add->ign_list, base->ign_list);
     if (add->opts == NO_OPTIONS) {
         /*
          * If the current directory explicitly says 'no options' then we also