[jboss-remoting-commits] JBoss Remoting SVN: r3858 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Wed Apr 2 00:30:18 EDT 2008
Author: ron.sigal at jboss.com
Date: 2008-04-02 00:30:17 -0400 (Wed, 02 Apr 2008)
New Revision: 3858
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
Log:
JBREM-934: Put InetAddress.getByName() call in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-04-02 04:29:51 UTC (rev 3857)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-04-02 04:30:17 UTC (rev 3858)
@@ -26,7 +26,6 @@
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvoker;
import org.jboss.remoting.util.TimerUtil;
-import org.jboss.remoting.loading.ClassByteClassLoader;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.util.propertyeditor.PropertyEditors;
import org.jboss.logging.Logger;
@@ -41,8 +40,8 @@
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
+import java.net.UnknownHostException;
import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
@@ -343,9 +342,24 @@
while (it.hasNext())
{
Home home = (Home) it.next();
- InetAddress inetAddress = InetAddress.getByName(home.host);
+ InetAddress inetAddress = null;
+ try
+ {
+ final Home finalHome = home;
+ inetAddress = (InetAddress)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws UnknownHostException
+ {
+ return InetAddress.getByName(finalHome.host);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (UnknownHostException) e.getCause();
+ }
+
ServerSocket ss = null;
-
try
{
ss = factory.createServerSocket();
More information about the jboss-remoting-commits
mailing list