From d4f25eed4675987322aef348563b6cf0c883ae1a Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 21 Nov 2011 05:13:45 +0000 Subject: [PATCH] rollback recent autoindex changes (1204355:1204306) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1204357 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 ------- docs/manual/mod/mod_autoindex.html.en | 4 ---- docs/manual/mod/mod_autoindex.xml | 4 ---- docs/manual/upgrading.html.en | 4 ---- docs/manual/upgrading.xml | 4 ---- modules/generators/mod_autoindex.c | 34 ++++++++++++++++++--------- 6 files changed, 23 insertions(+), 36 deletions(-) diff --git a/CHANGES b/CHANGES index bf62628551..91db4c5eb9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,15 +1,6 @@ -*- coding: utf-8 -*- Changes with Apache 2.4.0 - *) mod_autoindex: Start respecting IndexIgnore inside DirectoryMatch. - PR51471 [Eric Covener] - - *) mod_autoindex: Stop implicitly prefixing AddDescription "file" arguments - that contain both slashes and wild-cards with a '*'. [Eric Covener] - - *) mod_autoindex: Allow AddDescription "file" arguments to be an - absolute path as previously documented. PR39923 [Eric Covener] - *) mod_cache_disk: Remove the unnecessary intermediate brigade while writing to disk. Fixes a problem where mod_disk_cache was leaving buckets in the intermediate brigade and not passing them to out on diff --git a/docs/manual/mod/mod_autoindex.html.en b/docs/manual/mod/mod_autoindex.html.en index 66e5652108..8c4e6aefa1 100644 --- a/docs/manual/mod/mod_autoindex.html.en +++ b/docs/manual/mod/mod_autoindex.html.en @@ -323,10 +323,6 @@ icon selected by MIME content-type element (such as cutting off the end of a bolded phrase), the results may affect the rest of the directory listing.

-

Compatibility

-

Prior to version 2.4, any wild-card expression that contained slashes - was treated as if it started with a '*'.

-
top
diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml index ef3a215e4a..ab5f9acd64 100644 --- a/docs/manual/mod/mod_autoindex.xml +++ b/docs/manual/mod/mod_autoindex.xml @@ -314,10 +314,6 @@ icon selected by MIME content-type element (such as cutting off the end of a bolded phrase), the results may affect the rest of the directory listing.

- Compatibility -

Prior to version 2.4, any wild-card expression that contained slashes - was treated as if it started with a '*'.

-
diff --git a/docs/manual/upgrading.html.en b/docs/manual/upgrading.html.en index 844edd9938..a66e632452 100644 --- a/docs/manual/upgrading.html.en +++ b/docs/manual/upgrading.html.en @@ -274,10 +274,6 @@ display descriptions for .xhtml files, which were previously ignored. -
  • mod_autoindex: AddDescription 'file' arguments - that contain wild-cards and slashes are no longer implicitly treated - as if they began with a '*' character.
  • -
  • mod_ssl: The default format of the *_DN variables has changed. The old format can still be used with the new LegacyDNStringFormat argument to SSLOptions. The SSLv2 protocol is diff --git a/docs/manual/upgrading.xml b/docs/manual/upgrading.xml index 876fa60423..fab9d1cf3b 100644 --- a/docs/manual/upgrading.xml +++ b/docs/manual/upgrading.xml @@ -290,10 +290,6 @@ display descriptions for .xhtml files, which were previously ignored.
  • -
  • mod_autoindex: AddDescription 'file' arguments - that contain wild-cards and slashes are no longer implicitly treated - as if they began with a '*' character.
  • -
  • mod_ssl: The default format of the *_DN variables has changed. The old format can still be used with the new LegacyDNStringFormat argument to temp_pool, to); desc_entry = (ai_desc_t *) apr_array_push(dcfg->desc_list); desc_entry->full_path = (ap_strchr_c(to, '/') == NULL) ? 0 : 1; @@ -308,12 +307,7 @@ static const char *add_desc(cmd_parms *cmd, void *d, const char *desc, || desc_entry->full_path || apr_fnmatch_test(to)); if (desc_entry->wildcards) { - if (desc_entry->full_path && !is_abspath) { - prefix = "*/"; - } - else if (WILDCARDS_REQUIRED) { - prefix = "*"; - } + prefix = desc_entry->full_path ? "*/" : "*"; desc_entry->pattern = apr_pstrcat(dcfg->desc_list->pool, prefix, to, "*", NULL); } @@ -326,7 +320,7 @@ static const char *add_desc(cmd_parms *cmd, void *d, const char *desc, static const char *add_ignore(cmd_parms *cmd, void *d, const char *ext) { - push_item(((autoindex_config_rec *) d)->ign_list, cmd->info, ext, cmd->path, NULL); + push_item(((autoindex_config_rec *) d)->ign_list, 0, ext, cmd->path, NULL); return NULL; } @@ -587,7 +581,7 @@ static const command_rec autoindex_cmds[] = "one or more index options [+|-][]"), AP_INIT_TAKE2("IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS, "{Ascending,Descending} {Name,Size,Description,Date}"), - AP_INIT_ITERATE("IndexIgnore", add_ignore, BY_PATH, DIR_CMD_PERMS, + 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), @@ -876,13 +870,30 @@ static int ignore_entry(autoindex_config_rec *d, char *path) { apr_array_header_t *list = d->ign_list; struct item *items = (struct item *) list->elts; + char *tt; int i; + if ((tt = strrchr(path, '/')) == NULL) { + tt = path; + } + else { + tt++; + } + for (i = 0; i < list->nelts; ++i) { struct item *p = &items[i]; + char *ap; + + if ((ap = strrchr(p->apply_to, '/')) == NULL) { + ap = p->apply_to; + } + else { + ap++; + } #ifndef CASE_BLIND_FILESYSTEM - if (!ap_strcmp_match(path, p->apply_to)) { + if (!ap_strcmp_match(path, p->apply_path) + && !ap_strcmp_match(tt, ap)) { return 1; } #else /* !CASE_BLIND_FILESYSTEM */ @@ -891,7 +902,8 @@ static int ignore_entry(autoindex_config_rec *d, char *path) * a factor of the filesystem involved, but we can't detect that * reliably - so we have to granularise at the OS level. */ - if (!ap_strcasecmp_match(path, p->apply_to)) { + if (!ap_strcasecmp_match(path, p->apply_path) + && !ap_strcasecmp_match(tt, ap)) { return 1; } #endif /* !CASE_BLIND_FILESYSTEM */ -- 2.40.0