From c177578361f23d98e914e410a2924743e24087d8 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 9 Feb 2009 19:39:40 +0000 Subject: [PATCH] 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 --- java/org/apache/catalina/startup/HostConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()) -- 2.11.0