From: Graham Leggett Date: Mon, 1 Mar 2010 21:34:51 +0000 (+0000) Subject: When loading wildcards that are part of a path, only consider directories X-Git-Tag: 2.3.6~424 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ffe82f249613ede7bba93ae28a13939cf43b60a;p=thirdparty%2Fapache%2Fhttpd.git When loading wildcards that are part of a path, only consider directories and ignore other files. [Dan Poirier, Graham Leggett] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@917735 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/config.c b/server/config.c index 14061274990..d073adae9a7 100644 --- a/server/config.c +++ b/server/config.c @@ -1542,7 +1542,7 @@ static const char *process_command_config(server_rec *s, } typedef struct { - char *fname; + const char *fname; } fnames; static int fname_alphasort(const void *fn1, const void *fn2) @@ -1710,8 +1710,15 @@ static const char *process_resource_config_fnmatch(server_rec *s, && strcmp(dirent.name, "..") && (apr_fnmatch(fname, dirent.name, APR_FNM_PERIOD) == APR_SUCCESS)) { + const char *full_path = ap_make_full_path(ptemp, path, dirent.name); + /* If matching internal to path, and we happen to match something + * other than a directory, skip it + */ + if (rest && (rv == APR_SUCCESS) && (dirent.filetype != APR_DIR)) { + continue; + } fnew = (fnames *) apr_array_push(candidates); - fnew->fname = ap_make_full_path(ptemp, path, dirent.name); + fnew->fname = full_path; } }