[jboss-remoting-commits] JBoss Remoting SVN: r3765 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Mar 26 00:30:55 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-03-26 00:30:55 -0400 (Wed, 26 Mar 2008)
New Revision: 3765

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java	2008-03-26 04:30:00 UTC (rev 3764)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java	2008-03-26 04:30:55 UTC (rev 3765)
@@ -42,6 +42,9 @@
 import javax.net.SocketFactory;
 import javax.net.ssl.SSLServerSocketFactory;
 import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -414,15 +417,45 @@
          Map storeConfig = new HashMap();
          storeConfig.putAll(owner.getConfiguration());
 
-         String newFilePath = null;
+         String newFilePath = "data";
 
          String filePath = (String) storeConfig.get(CallbackStore.FILE_PATH_KEY);
          if(filePath == null)
          {
-            newFilePath = System.getProperty("jboss.server.data.dir", "data");
+            try
+            {
+               newFilePath = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+               {
+                  public Object run() throws Exception
+                  {
+                     return System.getProperty("jboss.server.data.dir", "data");
+                  }
+               });
+            }
+            catch (PrivilegedActionException e)
+            {
+               log.debug("error", e.getCause());
+            }
          }
-         newFilePath = newFilePath + System.getProperty("file.separator") + "remoting" +
-                       System.getProperty("file.separator") + sessionId;
+         
+         String separator = "/";
+         try
+         {
+            separator = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+            {
+               public Object run() throws Exception
+               {
+                  return System.getProperty("file.separator");
+               }
+            });
+         }
+         catch (PrivilegedActionException e)
+         {
+            log.debug("error", e.getCause());
+         }
+         
+         newFilePath = newFilePath + separator + "remoting" +
+         System.getProperty("file.separator") + sessionId;
 
          storeConfig.put(CallbackStore.FILE_PATH_KEY, newFilePath);
 




More information about the jboss-remoting-commits mailing list