Author: ron.sigal(a)jboss.com
Date: 2008-03-25 04:52:47 -0400 (Tue, 25 Mar 2008)
New Revision: 3742
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
Log:
JBREM-934: Put File.exists() in AccessController.doPrivileged() call.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java 2008-03-25
08:51:44 UTC (rev 3741)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java 2008-03-25
08:52:47 UTC (rev 3742)
@@ -22,6 +22,7 @@
package org.jboss.remoting.security;
import org.jboss.logging.Logger;
+import org.jboss.remoting.callback.CallbackStore.StoreFileFilter;
import org.jboss.remoting.serialization.ClassLoaderUtility;
import org.jboss.remoting.util.socket.RemotingKeyManager;
@@ -42,10 +43,12 @@
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
+import java.security.AccessController;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
+import java.security.PrivilegedAction;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
@@ -1602,9 +1605,16 @@
{
// Not a URL or a protocol without a handler so...
// next try to locate this as file path
- File tst = new File(storePath);
+ final File tst = new File(storePath);
+ Boolean exists = (Boolean) AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Boolean(tst.exists());
+ }
+ });
- if(tst.exists() == true)
+ if(exists.booleanValue())
{
url = tst.toURL();
}
Show replies by date