Author: ron.sigal(a)jboss.com
Date: 2008-03-25 00:42:32 -0400 (Tue, 25 Mar 2008)
New Revision: 3737
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java
Log:
JBREM-934: Put File.list() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java 2008-03-23
09:01:46 UTC (rev 3736)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java 2008-03-25
04:42:32 UTC (rev 3737)
@@ -24,7 +24,10 @@
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.serialization.SerializationStreamFactory;
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+import org.jboss.util.propertyeditor.PropertyEditors;
+import java.beans.IntrospectionException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -33,6 +36,10 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Arrays;
import java.util.Map;
@@ -385,8 +392,16 @@
private String[] getObjectFileList()
{
- File storePath = new File(filePath);
- String[] objectFileList = storePath.list(new StoreFileFilter());
+ final File storePath = new File(filePath);
+
+ String[] objectFileList = (String[]) AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return storePath.list(new StoreFileFilter());
+ }
+ });
+
Arrays.sort(objectFileList);
return objectFileList;
}
Show replies by date