coar        98/09/24 08:53:41

  Modified:    src/modules/standard mod_autoindex.c
  Log:
        mod_autoindex wasn't inheriting options from parent directories
        properly; the use of any other mod_autoindex directives in
        a .htaccess that didn't also include IndexOptions would wipe
        out any IndexOptions settings.
  
  PR:           3061
  
  Revision  Changes    Path
  1.93      +11 -2     apache-1.3/src/modules/standard/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- mod_autoindex.c   1998/09/24 10:41:55     1.92
  +++ mod_autoindex.c   1998/09/24 15:53:40     1.93
  @@ -93,6 +93,7 @@
   #define SUPPRESS_DESC 32
   #define SUPPRESS_PREAMBLE 64
   #define SUPPRESS_COLSORT 128
  +#define NO_OPTIONS 256
   
   #define K_PAD 1
   #define K_NOPAD 0
  @@ -331,7 +332,7 @@
               opts |= SUPPRESS_COLSORT;
        }
        else if (!strcasecmp(w, "None")) {
  -         opts = 0;
  +         opts = NO_OPTIONS;
        }
        else if (!strcasecmp(w, "IconWidth")) {
            d_cfg->icon_width = DEFAULT_ICON_WIDTH;
  @@ -362,6 +363,9 @@
            return "Invalid directory indexing option";
        }
       }
  +    if ((opts & NO_OPTIONS) && (opts & ~NO_OPTIONS)) {
  +     return "Cannot combine other IndexOptions keywords with 'None'";
  +    }
       d_cfg->opts = opts;
       return NULL;
   }
  @@ -436,7 +440,12 @@
       new->desc_list = ap_append_arrays(p, add->desc_list, base->desc_list);
       new->icon_list = ap_append_arrays(p, add->icon_list, base->icon_list);
       new->rdme_list = ap_append_arrays(p, add->rdme_list, base->rdme_list);
  -    new->opts = add->opts;
  +    if (add->opts & NO_OPTIONS) {
  +     new->opts = NO_OPTIONS;
  +    }
  +    else {
  +     new->opts = base->opts | add->opts;
  +    }
       new->name_width = add->name_width;
       new->name_adjust = add->name_adjust;
   
  
  
  

Reply via email to