https://issues.apache.org/bugzilla/show_bug.cgi?id=48863

--- Comment #7 from Konstantin Kolinko <knst.koli...@gmail.com> 2011-02-27 
13:46:41 EST ---
Regarding the patch that is applied to tc7 at r1073047 and is currently
proposed for 6.0.x:

1) The calls to ClassLoaderFactory#validateFile(file, type) pass canonical path
for DIR and JAR, but not for GLOB.  I mean, the following change to be done,
for consistency: (in trunk)

Index: java/org/apache/catalina/startup/ClassLoaderFactory.java
===================================================================
--- java/org/apache/catalina/startup/ClassLoaderFactory.java    (revision
1075098)
+++ java/org/apache/catalina/startup/ClassLoaderFactory.java    (working copy)
@@ -187,6 +187,7 @@
                     set.add(url);
                 } else if (repository.getType() == RepositoryType.GLOB) {
                     File directory=new File(repository.getLocation());
+                    directory = new File(directory.getCanonicalPath());
                     if (!validateFile(directory, RepositoryType.GLOB)) {
                         continue;
                     }

BTW, with the above change the calls to file.getAbsolutePath() inside of
#validateFile() become unnecessary.

2) The following check in ClassLoaderFactory#validateFile(file, type) assumes
that Bootstrap.getCatalinaBase() is an absolute (and canonical, because file is
canonical) path. But that is not guaranteed to be so:

if (!Bootstrap.getCatalinaHome().equals(       
                Bootstrap.getCatalinaBase()) &&
        file.getAbsolutePath().startsWith(     
                Bootstrap.getCatalinaBase())) {

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to