summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2011-11-21 01:04:58 +0000
committerEric Covener <covener@apache.org>2011-11-21 01:04:58 +0000
commit18716d0ee1ec7efa6c9f2bbda53a9dc09dd03ab7 (patch)
treeadfe780c8a458ea9c17b5eae58d3d30a20451fb8 /modules/generators
parentab2ad9974e665671a980d79fd57e8c2161a4f86a (diff)
downloadhttpd-18716d0ee1ec7efa6c9f2bbda53a9dc09dd03ab7.tar.gz
Merge r1204307 from trunk:
PR39923: Allow AddDescription to work with absolute filesystem paths, by not adding "*/" to their prefix (intended for relative paths) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1204309 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_autoindex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index b688867363..1007b8e7db 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -300,6 +300,7 @@ static const char *add_desc(cmd_parms *cmd, void *d, const char *desc,
autoindex_config_rec *dcfg = (autoindex_config_rec *) d;
ai_desc_t *desc_entry;
char *prefix = "";
+ int is_abspath = ap_os_is_path_absolute(cmd->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;
@@ -307,7 +308,12 @@ 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) {
- prefix = desc_entry->full_path ? "*/" : "*";
+ if (desc_entry->full_path && !is_abspath) {
+ prefix = "*/";
+ }
+ else if (WILDCARDS_REQUIRED) {
+ prefix = "*";
+ }
desc_entry->pattern = apr_pstrcat(dcfg->desc_list->pool,
prefix, to, "*", NULL);
}