]> granicus.if.org Git - apache/commitdiff
PR#47766 mod_autoindex directives not merged into sections with no autoindex directives.
authorEric Covener <covener@apache.org>
Fri, 5 Nov 2010 04:45:21 +0000 (04:45 +0000)
committerEric Covener <covener@apache.org>
Fri, 5 Nov 2010 04:45:21 +0000 (04:45 +0000)
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

CHANGES
modules/generators/mod_autoindex.c

diff --git a/CHANGES b/CHANGES
index 6e6420fdcfc3e66f733ccc8c636b518fba175333..fe703fb6b8b0958db353105a5af278325651a5e5 100644 (file)
--- 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]
index bf627b01dc18da5021c85765815f80f79b88706f..7a44519032bd3ff6161b5a9c4e1b9df16104db5e 100644 (file)
@@ -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;