tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r658139 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/catalina/loader/WebappClassLoader.java webapps/docs/changelog.xml
Date Tue, 20 May 2008 07:45:43 GMT
Author: markt
Date: Tue May 20 00:45:42 2008
New Revision: 658139

URL: http://svn.apache.org/viewvc?rev=658139&view=rev
Log:
Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=44282
Make TRACE level logging work with a security manager.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=658139&r1=658138&r2=658139&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue May 20 00:45:42 2008
@@ -39,13 +39,6 @@
   -1: remm: I believe it would need specific support for certain managers. Interested users
             could use their own extended manager instead.
 
-* Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=44282
-  Do call to getClassLoader() in a privileged block.
-  http://svn.apache.org/viewvc?rev=616953&view=rev
-  +1: markt, fhanik, yoavs
-  +0: remm: do we really want to fix these sort of "bugs" ?
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44595
   http://svn.apache.org/viewvc?view=rev&revision=645428
   +1: jfclere, rjung, fhanik, remm, pero

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=658139&r1=658138&r2=658139&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Tue May 20
00:45:42 2008
@@ -55,6 +55,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
 
+import org.apache.catalina.Globals;
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
@@ -129,6 +130,23 @@
 
     }
 
+    
+    protected final class PrivilegedGetClassLoader
+        implements PrivilegedAction<ClassLoader> {
+
+        public Class<?> clazz;
+
+        public PrivilegedGetClassLoader(Class<?> clazz){
+            this.clazz = clazz;
+        }
+
+        public ClassLoader run() {       
+            return clazz.getClassLoader();
+        }           
+    }
+
+    
+
 
     // ------------------------------------------------------- Static Variables
 
@@ -908,8 +926,17 @@
         // Return the class we have located
         if (log.isTraceEnabled())
             log.debug("      Returning class " + clazz);
-        if ((log.isTraceEnabled()) && (clazz != null))
-            log.debug("      Loaded by " + clazz.getClassLoader());
+        
+        if ((log.isTraceEnabled()) && (clazz != null)) {
+            ClassLoader cl;
+            if (Globals.IS_SECURITY_ENABLED){
+                cl = AccessController.doPrivileged(
+                    new PrivilegedGetClassLoader(clazz));
+            } else {
+                cl = clazz.getClassLoader();
+            }
+            log.debug("      Loaded by " + cl.toString());
+        }
         return (clazz);
 
     }

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=658139&r1=658138&r2=658139&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue May 20 00:45:42 2008
@@ -94,7 +94,11 @@
       </update>
       <fix>
         <bug>44021</bug>: Add support for using the # character to define
-        multi-level contexts in WARs and dirctories in the appBase. (markt)
+        multi-level contexts in WARs and directories in the appBase. (markt)
+      </fix>
+      <fix>
+        <bug>44282</bug>: Fix TRACE level class loader logging message when a
+        security manager is used. (markt)
       </fix>
       <fix>
         <bug>44337</bug>:   Dir listing crashes if no readme-file present (funkman)



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


Mime
View raw message