]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Issue a warning for non-existent directories when running configtest
authorEric Covener <covener@apache.org>
Sat, 11 Apr 2020 18:47:46 +0000 (18:47 +0000)
committerEric Covener <covener@apache.org>
Sat, 11 Apr 2020 18:47:46 +0000 (18:47 +0000)
Submitted By: Stéphane Blondon <stephane.blondon gmail.com>
Committed By: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876402 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/log-message-tags/next-number
server/core.c

diff --git a/CHANGES b/CHANGES
index 4254b39606cf0572c888e795f772d84d4d2e34df..b8e8f907592b187e295bd23f464bc44029766fb6 100644 (file)
--- 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 <Directory> config
+     sections. PR63079. [Stephane Blondon <stephane.blondon gmail.com>].
+
   *) 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 <dzwillo@strato.de>]
index f43722f0c95c813825ed2c951aad93b42d50c3f1..5ed9a8cf20e3b0c6b9a3d7c2558ae1f1a19ea3db 100644 (file)
@@ -1 +1 @@
-10234
+10235
index 3a00761b76dbefae97025a898b19c65fc3fe99dd..1b6c98251a12d12f89f5c9e8e8d0c5cc8db071f6 100644 (file)
@@ -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: <Directory \"%s\"> 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);