You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2011/11/21 02:03:15 UTC
svn commit: r1204307 - /httpd/httpd/trunk/modules/generators/mod_autoindex.c
Author: covener
Date: Mon Nov 21 01:03:15 2011
New Revision: 1204307
URL: http://svn.apache.org/viewvc?rev=1204307&view=rev
Log:
PR39923: Allow AddDescription to work with absolute filesystem paths,
by not adding "*/" to their prefix (intended for relative paths)
Modified:
httpd/httpd/trunk/modules/generators/mod_autoindex.c
Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1204307&r1=1204306&r2=1204307&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Mon Nov 21 01:03:15 2011
@@ -300,6 +300,7 @@ static const char *add_desc(cmd_parms *c
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 *c
|| 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);
}