From: William A. Rowe Jr Date: Tue, 14 Jan 2003 16:56:16 +0000 (+0000) Subject: ap_server_root_relative never guarenteed that the resource exists, or X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71911f1e6991c58e7ba5be9f679a2cead1f02003;p=apache 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 --- 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)