diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-23 13:44:14 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-23 13:44:14 +0000 |
commit | 61754d1a6a1a2db2c74d15df99913ecca77d8a22 (patch) | |
tree | 43d291456002a3295d93889429053c9f0c49f37f /lib | |
parent | a5b229bebffbefd39e8a9071cf3e00ed0a9f601f (diff) |
merge revision(s) r45144: [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_1@46909 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 6b2fa9d903..60b2d9091c 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -653,7 +653,9 @@ class Resolv begin port = rangerand(1024..65535) udpsock.bind(bind_host, port) - rescue Errno::EADDRINUSE, Errno::EACCES + 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 |