Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=35054
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 20 May 2011 18:11:53 +0000 (18:11 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 20 May 2011 18:11:53 +0000 (18:11 +0000)
Check that a file is not specified for a Host's appBase and log an error if it is.

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

java/org/apache/catalina/startup/HostConfig.java
webapps/docs/changelog.xml

index 758d63a..2f79404 100644 (file)
@@ -1312,7 +1312,7 @@ public class HostConfig
         if (host.getCreateDirs()) {
             File[] dirs = new File[] {appBase(),configBase()};
             for (int i=0; i<dirs.length; i++) {
-                if ( (!dirs[i].exists()) && (!dirs[i].mkdirs())) {
+                if ( (!dirs[i].isDirectory()) && (!dirs[i].mkdirs())) {
                     log.error(sm.getString("hostConfig.createDirs",dirs[i]));
                 }
             }
index 6d03d81..ec89135 100644 (file)
   <subsection name="Catalina">
     <changelog>
       <fix>
+        <bug>35054</bug>: Check that a file is not specified for a Host&apos;s
+        appBase and log an error if it is. (markt)
+      </fix>
+      <fix>
         <bug>51197</bug>: Fix possible dropped connection when sendError or
         sendRedirst are used during async processing. (markt)
       </fix>