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 2016/10/04 06:39:10 UTC

svn commit: r1763232 - in /tomcat/trunk: java/org/apache/naming/factory/ResourceLinkFactory.java webapps/docs/changelog.xml

Author: markt
Date: Tue Oct  4 06:39:10 2016
New Revision: 1763232

URL: http://svn.apache.org/viewvc?rev=1763232&view=rev
Log:
Improve the access checks for linked global resources to handle the case where the current class loader is a child of the web application class loader.

Modified:
    tomcat/trunk/java/org/apache/naming/factory/ResourceLinkFactory.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/naming/factory/ResourceLinkFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/ResourceLinkFactory.java?rev=1763232&r1=1763231&r2=1763232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/ResourceLinkFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/ResourceLinkFactory.java Tue Oct  4 06:39:10 2016
@@ -109,9 +109,12 @@ public class ResourceLinkFactory impleme
 
     private static boolean validateGlobalResourceAccess(String globalName) {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        Map<String,String> registrations = globalResourceRegistrations.get(cl);
-        if (registrations != null && registrations.containsValue(globalName)) {
-            return true;
+        while (cl != null) {
+            Map<String,String> registrations = globalResourceRegistrations.get(cl);
+            if (registrations != null && registrations.containsValue(globalName)) {
+                return true;
+            }
+            cl = cl.getParent();
         }
         return false;
     }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1763232&r1=1763231&r2=1763232&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Oct  4 06:39:10 2016
@@ -102,6 +102,11 @@
         When starting web resources, ensure that class resources are only
         started once. (markt)
       </fix>
+      <fix>
+        Improve the access checks for linked global resources to handle the case
+        where the current class loader is a child of the web application class
+        loader. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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