From: markt Date: Mon, 9 Feb 2009 19:39:40 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39013 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c177578361f23d98e914e410a2924743e24087d8;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39013 When testing for invalid docBase, test for an exact match with the appBase dir git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@742697 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index 0b0644cc6..a2a7cd833 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -1079,7 +1079,7 @@ public class HostConfig try { File current = new File(resources[j]); current = current.getCanonicalFile(); - if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath())) + if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator)) || (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) { if (log.isDebugEnabled()) log.debug("Delete " + current); @@ -1120,7 +1120,7 @@ public class HostConfig try { File current = new File(resources[j]); current = current.getCanonicalFile(); - if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath())) + if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator)) || (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) { if (log.isDebugEnabled()) log.debug("Delete " + current); @@ -1138,7 +1138,7 @@ public class HostConfig try { File current = new File(resources2[j]); current = current.getCanonicalFile(); - if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath())) + if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator)) || ((current.getAbsolutePath().startsWith(configBase().getAbsolutePath()) && (current.getAbsolutePath().endsWith(".xml"))))) { if (log.isDebugEnabled())