From 08309dbff6d428f3dff2e6e019de2318b3632d0a Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 4 Dec 2010 16:23:02 +0000 Subject: [PATCH] PR#24243: allow some control over how IndexIgnore'd files are merged. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042209 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ docs/manual/mod/mod_autoindex.xml | 31 ++++++++++++++++++++++++++++++ modules/generators/mod_autoindex.c | 7 ++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 213a8a2bc9..88e017b58a 100644 --- 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] diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml index c71fa0aef9..dbc285f58b 100644 --- a/docs/manual/mod/mod_autoindex.xml +++ b/docs/manual/mod/mod_autoindex.xml @@ -517,6 +517,37 @@ a directory + +IndexIgnoreReset +Empties the list of files to hide when listing +a directory +IndexIgnoreReset ON|OFF +server configvirtual host +directory.htaccess + +Indexes + + +

The IndexIgnoreReset directive removes + any files ignored by IndexIgnore otherwise + inherited from other configuration sections.

+ + + <Directory /var/www> + IndexIgnore *.bak .??* *~ *# HEADER* README* RCS CVS *,v *,t + </Directory> + <Directory /var/www/backups> + IndexIgnoreReset ON + IndexIgnore .??* *# HEADER* README* RCS CVS *,v *,t + </Directory> + + +

Review the default configuration for a list of + patterns that you might want to explicitly ignore after using this + directive.

+
+
+ IndexOptions Various configuration settings for directory diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 7a44519032..8416677267 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -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 -- 2.40.0