JBoss Remoting SVN: r3745 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 05:02:21 -0400 (Tue, 25 Mar 2008)
New Revision: 3745
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
Log:
JBREM-936: resolveHost() checks for host == null.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-03-25 08:59:05 UTC (rev 3744)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-03-25 09:02:21 UTC (rev 3745)
@@ -455,8 +455,12 @@
private static final String resolveHost(String host)
{
- if(host.indexOf("0.0.0.0") != -1)
+ if (host == null)
{
+ host = fixRemoteAddress(host);
+ }
+ else if(host.indexOf("0.0.0.0") != -1)
+ {
if(System.getProperty(SERVER_BIND_ADDRESS, "0.0.0.0").equals("0.0.0.0"))
{
host = fixRemoteAddress(host);
16 years, 9 months
JBoss Remoting SVN: r3744 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 04:59:05 -0400 (Tue, 25 Mar 2008)
New Revision: 3744
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
Log:
BREM-937: ControlConnectionThread.run() calls SocketServerInvoker.processInvocation().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-03-25 08:55:15 UTC (rev 3743)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-03-25 08:59:05 UTC (rev 3744)
@@ -58,7 +58,6 @@
import org.jboss.remoting.socketfactory.SocketCreationListener;
import org.jboss.remoting.transport.PortUtil;
import org.jboss.remoting.transport.socket.LRUPool;
-import org.jboss.remoting.transport.socket.ServerThread;
import org.jboss.remoting.transport.socket.SocketServerInvoker;
@@ -1061,33 +1060,14 @@
return;
}
- synchronized (clientpool)
+ try
{
- if(clientpool.size() < maxPoolSize)
- {
- Thread thread = null;
- try
- {
- thread = new ServerThread(socket, BisocketServerInvoker.this,
- clientpool, threadpool,
- getTimeout(), serverSocketClass);
- thread.start();
-
- if (log.isDebugEnabled())
- log.debug("created: " + thread);
- }
- catch (Exception e)
- {
- log.error("Unable to create new ServerThread: " + e.getMessage());
- e.printStackTrace();
- }
-
- synchronized (threadpool)
- {
- threadpool.add(thread);
- }
- }
+ processInvocation(socket);
}
+ catch (Exception e)
+ {
+ log.error("Unable to create new ServerThread: " + e.getMessage(), e);
+ }
}
}
}
16 years, 9 months
JBoss Remoting SVN: r3743 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 04:55:15 -0400 (Tue, 25 Mar 2008)
New Revision: 3743
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920: Added some privileges, moved some from Remoting proper to test classes.
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-25 08:52:47 UTC (rev 3742)
+++ remoting2/branches/2.x/test.policy 2008-03-25 08:55:15 UTC (rev 3743)
@@ -17,17 +17,11 @@
permission javax.management.MBeanTrustPermission "register";
permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#MBeanServerId[JMImplementation:type=MBeanServerDelegate]", "getAttribute";
permission javax.management.MBeanPermission "-#-[-]", "queryMBeans";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=127.0.0.1,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=localhost,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::ffff:127.0.0.1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=sslsocket,type=Connector]", "queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#-[JMImplementation:type=MBeanServerDelegate]", "queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#-[JMImplementation:type=MBeanServerDelegate]", "queryMBeans, isInstanceOf, getAttribute";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=JNDIDetector]", "queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MultiplexDetector]", "queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "queryMBeans, isInstanceOf, unregisterMBean";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#Servers[remoting:type=NetworkRegistry]", "getAttribute";
@@ -68,6 +62,7 @@
// Used by org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(), though still a Remoting permission I think
permission java.lang.RuntimePermission "accessClassInPackage.sun.beans.editors";
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.http";
// TODO - JBoss Serialization SHOULD be doing these operations in a privileged block - JBSER-105
permission java.lang.RuntimePermission "accessDeclaredMembers";
@@ -113,8 +108,14 @@
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission javax.management.MBeanServerPermission "createMBeanServer, findMBeanServer";
permission javax.management.MBeanTrustPermission "register";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=127.0.0.1,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=localhost,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::ffff:127.0.0.1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:*,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[test:type=connector]", "registerMBean";
permission javax.management.MBeanPermission "org.jboss.test.remoting.detection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=JNDIDetector]", "registerMBean, queryMBeans, isInstanceOf";
@@ -126,7 +127,11 @@
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "setContextClassLoader";
+ permission java.io.FilePermission "${build.home}/output/tests/classes/org/jboss/test/remoting/classloader/race/test.jar", "read";
+ // Used by the descendents of org.jboss.test.remoting.shutdown.ShutdownTestParent.
+ permission java.io.FilePermission "<<ALL FILES>>", "execute";
+
// This is technically the JNP server, but it seems intentional - note that this might mask other problems though
permission java.net.SocketPermission "*:*", "accept, connect, resolve";
16 years, 9 months
JBoss Remoting SVN: r3742 - remoting2/branches/2.x/src/main/org/jboss/remoting/security.
by jboss-remoting-commits@lists.jboss.org
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();
}
16 years, 9 months
JBoss Remoting SVN: r3741 - remoting2/branches/2.x/src/main/org/jboss/remoting/ident.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 04:51:44 -0400 (Tue, 25 Mar 2008)
New Revision: 3741
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
Log:
JBREM-934: Put MBeanServer.getAttribute() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-25 04:46:15 UTC (rev 3740)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-25 08:51:44 UTC (rev 3741)
@@ -21,6 +21,7 @@
*/
package org.jboss.remoting.ident;
+import org.jboss.remoting.loading.ClassByteClassLoader;
import org.jboss.remoting.network.NetworkRegistry;
import javax.management.MBeanServer;
@@ -34,6 +35,9 @@
import java.io.Serializable;
import java.net.InetAddress;
import java.rmi.dgc.VMID;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
@@ -194,7 +198,7 @@
return false;
}
- public static synchronized final Identity get(MBeanServer server)
+ public static synchronized final Identity get(final MBeanServer server)
{
if(identities.containsKey(server))
{
@@ -212,7 +216,22 @@
localHost = InetAddress.getByName("127.0.0.1");
}
- String serverid = (String) server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
+ String serverid = null;
+ try
+ {
+ serverid = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
Identity identity = new Identity(localHost, createId(server), serverid);
identities.put(server, identity);
return identity;
16 years, 9 months
JBoss Remoting SVN: r3740 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 00:46:15 -0400 (Tue, 25 Mar 2008)
New Revision: 3740
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
Log:
JBREM-934: In PropertyEditors.mapJavaBeanProperties() in AccessController.doPrivileged() call, changed "this" to SocketServerInvoker.this.
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-03-25 04:45:20 UTC (rev 3739)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-03-25 04:46:15 UTC (rev 3740)
@@ -188,7 +188,7 @@
{
public Object run() throws IntrospectionException
{
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+ PropertyEditors.mapJavaBeanProperties(SocketServerInvoker.this, props, false);
return null;
}
});
16 years, 9 months
JBoss Remoting SVN: r3739 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 00:45:20 -0400 (Tue, 25 Mar 2008)
New Revision: 3739
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-934: In PropertyEditors.mapJavaBeanProperties() in AccessController.doPrivileged() call, changed "this" to MicroSocketClientInvoker.this.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-25 04:43:59 UTC (rev 3738)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-25 04:45:20 UTC (rev 3739)
@@ -490,7 +490,7 @@
{
public Object run() throws IntrospectionException
{
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+ PropertyEditors.mapJavaBeanProperties(MicroSocketClientInvoker.this, props, false);
return null;
}
});
16 years, 9 months
JBoss Remoting SVN: r3738 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-25 00:43:59 -0400 (Tue, 25 Mar 2008)
New Revision: 3738
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-934: Put PropertyEditors.mapJavaBeanProperties() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-25 04:42:32 UTC (rev 3737)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-25 04:43:59 UTC (rev 3738)
@@ -155,7 +155,7 @@
{
public Object run() throws IntrospectionException
{
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+ PropertyEditors.mapJavaBeanProperties(RMIServerInvoker.this, props, false);
return null;
}
});
16 years, 9 months
JBoss Remoting SVN: r3737 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
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;
}
16 years, 9 months
JBoss Remoting SVN: r3736 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-23 05:01:46 -0400 (Sun, 23 Mar 2008)
New Revision: 3736
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
Log:
JBREM-915: Added testNullHost().
Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-23 09:00:39 UTC (rev 3735)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/locator/InvokerLocatorTestCase.java 2008-03-23 09:01:46 UTC (rev 3736)
@@ -22,6 +22,8 @@
package org.jboss.test.remoting.locator;
+import java.net.InetAddress;
+
import junit.framework.TestCase;
import org.jboss.remoting.InvokerLocator;
@@ -109,5 +111,32 @@
assertEquals("socket://myhost", origUrl);
}
+
+ public void testNullHost() throws Exception
+ {
+ InvokerLocator locator = new InvokerLocator("socket://:7777");
+ String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+ boolean byHost = true;
+ String host = null;
+
+ try
+ {
+ byHost = Boolean.getBoolean(bindByHost);
+ }
+ catch(Exception e)
+ {
+ }
+ if(byHost)
+ {
+ host = InetAddress.getLocalHost().getHostName();
+ }
+ else
+ {
+ host = InetAddress.getLocalHost().getHostAddress();
+ }
+
+ assertEquals(host, locator.getHost());
+ }
+
}
\ No newline at end of file
16 years, 9 months