With the default of all permissions, executing this test java secGetChannel throws no socket exceptions. It tests two Socket constructors: Socket (InetAddress remotehost, int port, InetAddress host, int localport) Socket ( String remotehost, int port, InetAddress host, int localport) Executing the test with attached policy which gives all SocketPermission to the "localhost", and for the test's remote host, impulse.sfbay , in both forms "10.5.35.3:0-" and "10.5.35.3:-1" java -Djava.security.manager -Djava.security.policy=mysec.policy secGetChannel throws NoRouteToHostException "Cannot assign requested address" for both constructors: java.net.NoRouteToHostException: Cannot assign requested address at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:298) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:164) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:151) at java.net.Socket.connect(Socket.java:428) at java.net.Socket.connect(Socket.java:378) at java.net.Socket.<init>(Socket.java:293) at java.net.Socket.<init>(Socket.java:201) at secGetChannel.<init>(secGetChannel.java:28) Executing the test on win98 in both default and sec mgr w/ policy mode throws no exceptions.
|