From: Eric Covener Date: Fri, 5 Nov 2010 04:45:21 +0000 (+0000) Subject: PR#47766 mod_autoindex directives not merged into sections with no autoindex directives. X-Git-Tag: 2.3.9~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=025ffd86861d1a7bdbafb5785875cf17725830e3;p=apache PR#47766 mod_autoindex directives not merged into sections with no autoindex directives. This is due to an empty "opts" field looking just like one that has specified "None". None is always alone, so simplify and test for equality. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031430 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 6e6420fdcf..fe703fb6b8 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,10 @@ Changes with Apache 2.3.9 Fix a denial of service attack against mod_reqtimeout. [Stefan Fritsch] + *) mod_autoindex: Fix inheritance of mod_autoindex directives into + contexts that don't have any mod_autoindex directives. PR47766. + [Eric Covener] + *) mod_rewrite: Add END flag for RewriteRule to prevent further rounds of rewrite processing when a per-directory substitution occurs. [Eric Covener] diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index bf627b01dc..7a44519032 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -72,6 +72,7 @@ module AP_MODULE_DECLARE_DATA autoindex_module; #define EMIT_XHTML (1 << 17) #define SHOW_FORBIDDEN (1 << 18) #define ADDALTCLASS (1 << 19) +#define OPTION_UNSET (1 << 20) #define K_NOADJUST 0 #define K_ADJUST 1 @@ -619,7 +620,7 @@ static void *create_autoindex_config(apr_pool_t *p, char *dummy) new->alt_list = apr_array_make(p, 4, sizeof(struct item)); new->desc_list = apr_array_make(p, 4, sizeof(ai_desc_t)); new->ign_list = apr_array_make(p, 4, sizeof(struct item)); - new->opts = 0; + new->opts = OPTION_UNSET; new->incremented_opts = 0; new->decremented_opts = 0; new->default_keyid = '\0'; @@ -655,9 +656,9 @@ static void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv) 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); - if (add->opts & NO_OPTIONS) { + if (add->opts == NO_OPTIONS) { /* - * If the current directory says 'no options' then we also + * If the current directory explicitly says 'no options' then we also * clear any incremental mods from being inheritable further down. */ new->opts = NO_OPTIONS; @@ -671,7 +672,7 @@ static void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv) * Contrariwise, we *do* inherit if the only settings here are * incremental ones. */ - if (add->opts == 0) { + if (add->opts == OPTION_UNSET) { new->incremented_opts = (base->incremented_opts | add->incremented_opts) & ~add->decremented_opts;