From a2af7923e51c0e09e7ac848787a1a51f2083d805 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 14 Jan 2003 16:56:16 +0000 Subject: [PATCH] ap_server_root_relative never guarenteed that the resource exists, or isn't a file pattern. Correct the code to accept these cases (applied to both 2.0 and 2.1.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98264 13f79535-47bb-0310-9956-ffa450edef68 --- server/config.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/config.c b/server/config.c index b50adbd606..f7ab12b0b8 100644 --- a/server/config.c +++ b/server/config.c @@ -1276,12 +1276,18 @@ static cmd_parms default_parms = AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char *file) { - char *newpath; - if (apr_filepath_merge(&newpath, ap_server_root, file, - APR_FILEPATH_TRUENAME, p) == APR_SUCCESS) + char *newpath = NULL; + apr_status_t rv; + rv = apr_filepath_merge(&newpath, ap_server_root, file, + APR_FILEPATH_TRUENAME, p); + if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv) + || APR_STATUS_IS_ENOENT(rv) + || APR_STATUS_IS_ENOTDIR(rv)) { return newpath; - else + } + else { return NULL; + } } AP_DECLARE(const char *) ap_soak_end_container(cmd_parms *cmd, char *directive) -- 2.50.1