Author: ron.sigal(a)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)
Show replies by date