diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-31 07:22:16 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-31 07:22:16 +0000 |
commit | 96fac49c19cef2dedf835cd00eb57ad523fd5e1f (patch) | |
tree | 95fc288567d3309434a197a7093b2577a95ac147 /lib | |
parent | 6ffd2d5df78181a529bf7cfc71de79559d51d489 (diff) |
merge revision(s) 45144: [Backport #9544]
* lib/resolv.rb (bind_random_port): Rescue EPERM for FreeBSD which
security.mac.portacl.port_high is changed.
See mac_portacl(4) for details.
Reported by Jakub Szafranski. [ruby-core:60917] [Bug #9544]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/resolv.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb index 6cf96a7035..53bfd54a11 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -646,7 +646,9 @@ class Resolv begin port = rangerand(1024..65535) udpsock.bind(bind_host, port) - rescue Errno::EADDRINUSE + rescue Errno::EADDRINUSE, # POSIX + Errno::EACCES, # SunOS: See PRIV_SYS_NFS in privileges(5) + Errno::EPERM # FreeBSD: security.mac.portacl.port_high is configurable. See mac_portacl(4). retry end end |