You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2010/12/04 17:23:03 UTC

svn commit: r1042209 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_autoindex.xml modules/generators/mod_autoindex.c

Author: covener
Date: Sat Dec  4 16:23:02 2010
New Revision: 1042209

URL: http://svn.apache.org/viewvc?rev=1042209&view=rev
Log:
PR#24243: allow some control over how IndexIgnore'd files are merged.


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
    httpd/httpd/trunk/modules/generators/mod_autoindex.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1042209&r1=1042208&r2=1042209&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Dec  4 16:23:02 2010
@@ -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]
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml?rev=1042209&r1=1042208&r2=1042209&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml Sat Dec  4 16:23:02 2010
@@ -518,6 +518,37 @@ a directory</description>
 </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
 indexing</description>

Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1042209&r1=1042208&r2=1042209&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Sat Dec  4 16:23:02 2010
@@ -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
     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