From: Eric Covener Date: Sat, 11 Apr 2020 18:47:46 +0000 (+0000) Subject: Issue a warning for non-existent directories when running configtest X-Git-Tag: 2.5.0-alpha2-ci-test-only~1533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb65d8c78077c735f001bac25592469160fa6204;p=thirdparty%2Fapache%2Fhttpd.git Issue a warning for non-existent directories when running configtest Submitted By: Stéphane Blondon Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876402 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4254b39606c..b8e8f907592 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) configtest: Issue a warning for non-existent directories in config + sections. PR63079. [Stephane Blondon ]. + *) mod_proxy_http: Fix random memory-corruption in case of an error while reading a response from the backend. PR 64234 [Ruediger Pluem, Barnim Dzwillo ] diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index f43722f0c95..5ed9a8cf20e 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10234 +10235 diff --git a/server/core.c b/server/core.c index 3a00761b76d..1b6c98251a1 100644 --- a/server/core.c +++ b/server/core.c @@ -2532,6 +2532,7 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) } else if (strcmp(cmd->path, "/") != 0) { + int run_mode = ap_state_query(AP_SQ_RUN_MODE); char *newpath; /* @@ -2544,6 +2545,14 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) "\"> path is invalid.", NULL); } + if (run_mode == AP_SQ_RM_CONFIG_TEST && + !ap_is_directory(cmd->temp_pool, cmd->path)) { + ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0, + cmd->temp_pool, APLOGNO(10234) + "Warning: does not exist or is not a directory", + cmd->path); + } + cmd->path = newpath; if (cmd->path[strlen(cmd->path) - 1] != '/') cmd->path = apr_pstrcat(cmd->pool, cmd->path, "/", NULL);