tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r695274 - in /tomcat/trunk/java/org/apache/catalina: loader/WebappLoader.java util/ExtensionValidator.java
Date Sun, 14 Sep 2008 20:01:21 GMT
Author: markt
Date: Sun Sep 14 13:01:21 2008
New Revision: 695274

URL: http://svn.apache.org/viewvc?rev=695274&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45785
Ignore directories named xxx.jar in WEB-INF/lib

Modified:
    tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
    tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=695274&r1=695273&r2=695274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Sun Sep 14 13:01:21 2008
@@ -994,6 +994,10 @@
                     // impossible to update it or remove it at runtime)
                     File destFile = new File(destDir, binding.getName());
 
+                    // Ignore directories named xxx.jar
+                    if (destFile.isDirectory())
+                        continue;
+
                     if( log.isDebugEnabled())
                     log.debug(sm.getString("webappLoader.jarDeploy", filename,
                                      destFile.getAbsolutePath()));

Modified: tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java?rev=695274&r1=695273&r2=695274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java Sun Sep 14 13:01:21
2008
@@ -180,8 +180,13 @@
                 if (!binding.getName().toLowerCase().endsWith(".jar")) {
                     continue;
                 }
-                Resource resource = (Resource)dirContext.lookup
-                                        ("/WEB-INF/lib/" + binding.getName());
+                Object obj =
+                    dirContext.lookup("/WEB-INF/lib/" + binding.getName());
+                if (!(obj instanceof Resource)) {
+                    // Probably a directory named xxx.jar - ignore it
+                    continue;
+                }
+                Resource resource = (Resource) obj;
                 Manifest jmanifest = getManifest(resource.streamContent());
                 if (jmanifest != null) {
                     ManifestResource mre = new ManifestResource(



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


Mime
View raw message