--- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java Thu Oct 24 10:02:26 2013 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java Thu Oct 24 20:39:21 2013 +0100
@@ -572,6 +572,10 @@
throw new AlreadyBoundException();
InetSocketAddress isa = (local == null) ?
new InetSocketAddress(0) : Net.checkAddress(local);
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null) {
+ sm.checkListen(isa.getPort());
+ }
NetHooks.beforeTcpBind(fd, isa.getAddress(), isa.getPort());
Net.bind(fd, isa.getAddress(), isa.getPort());
localAddress = Net.localAddress(fd);