You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/02/09 20:39:40 UTC

svn commit: r742697 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Author: markt
Date: Mon Feb  9 19:39:40 2009
New Revision: 742697

URL: http://svn.apache.org/viewvc?rev=742697&view=rev
Log:
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

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=742697&r1=742696&r2=742697&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Mon Feb  9 19:39:40 2009
@@ -1079,7 +1079,7 @@
                         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 @@
                     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 @@
                     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())



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org