diff -urNp -x '*.orig' apache_1.3.42.org/src/modules/standard/mod_autoindex.c apache_1.3.42/src/modules/standard/mod_autoindex.c --- apache_1.3.42.org/src/modules/standard/mod_autoindex.c 2023-02-02 22:43:12.489834914 +0100 +++ apache_1.3.42/src/modules/standard/mod_autoindex.c 2023-02-02 22:43:12.716501580 +0100 @@ -59,6 +59,7 @@ module MODULE_VAR_EXPORT autoindex_modul #define TRACK_MODIFIED 1024 #define SORT_NOCASE 2048 #define STUDLY_INDEXING 4096 +#define INDEXOPT_INDEXES 8192 #define K_PAD 1 #define K_NOPAD 0 @@ -421,6 +422,9 @@ static const char *add_opts(cmd_parms *c else if (!strcasecmp(w, "IgnoreCase")) { option = SORT_NOCASE; } + else if (!strcasecmp(w, "Indexes")) { + option = INDEXOPT_INDEXES; + } else if (!strcasecmp(w, "None")) { if (action != '\0') { return "Cannot combine '+' or '-' with 'None' keyword"; @@ -1970,7 +1974,7 @@ static int index_directory(request_rec * static int handle_autoindex(request_rec *r) { autoindex_config_rec *d; - int allow_opts = ap_allow_options(r); + int opt_indexes = ap_allow_options(r) & OPT_INDEXES; d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config, &autoindex_module); @@ -1981,8 +1985,12 @@ static int handle_autoindex(request_rec } /* OK, nothing easy. Trot out the heavy artillery... */ + if ((d->incremented_opts & INDEXOPT_INDEXES) || + (d->opts & INDEXOPT_INDEXES)) opt_indexes = 1; + if ((d->decremented_opts & INDEXOPT_INDEXES) && + !(d->opts & INDEXOPT_INDEXES)) opt_indexes = 0; - if (allow_opts & OPT_INDEXES) { + if (opt_indexes) { /* KLUDGE --- make the sub_req lookups happen in the right directory. * Fixing this in the sub_req_lookup functions themselves is difficult, * and would probably break virtual includes...