[jboss-remoting-commits] JBoss Remoting SVN: r3836 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Tue Apr 1 23:56:30 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-01 23:56:30 -0400 (Tue, 01 Apr 2008)
New Revision: 3836

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptionManager.java
Log:
JBREM-934: Put Thread().getContextClassLoader() call in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptionManager.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptionManager.java	2008-04-02 03:55:07 UTC (rev 3835)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptionManager.java	2008-04-02 03:56:30 UTC (rev 3836)
@@ -29,7 +29,9 @@
 import java.io.InputStream;
 import java.io.ObjectInput;
 import java.io.ObjectInputStream;
+import java.security.AccessController;
 import java.security.Key;
+import java.security.PrivilegedAction;
 import java.util.Map;
 
 //$Id$
@@ -164,7 +166,13 @@
     */
    private static Key loadKey(String algo) throws Exception
    {
-      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+      ClassLoader tcl = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
+      {
+         public Object run()
+         {
+            return Thread.currentThread().getContextClassLoader();
+         }
+      });
       String file = "org/jboss/remoting/marshall/encryption/"+algo+".key";
       InputStream is = tcl.getResourceAsStream(file);
       if(is == null)




More information about the jboss-remoting-commits mailing list