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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Mar 26 00:28:53 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-03-26 00:28:53 -0400 (Wed, 26 Mar 2008)
New Revision: 3763

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

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java	2008-03-26 04:27:57 UTC (rev 3762)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java	2008-03-26 04:28:53 UTC (rev 3763)
@@ -56,6 +56,8 @@
 import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.UnknownHostException;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -1268,14 +1270,25 @@
       {
          // now need to get some external bindable address
          boolean byHost = true;
-         String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+         String bindByHost = "True";
+         
          try
          {
-            byHost = Boolean.valueOf(bindByHost).booleanValue();
+            bindByHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+            {
+               public Object run() throws Exception
+               {
+                  return System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+               }
+            });
          }
-         catch(Exception e)
+         catch (Exception e)
          {
+            log.debug("error", e.getCause());
          }
+         
+         byHost = Boolean.valueOf(bindByHost).booleanValue();
+         
          try
          {
             if(byHost)




More information about the jboss-remoting-commits mailing list