summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 17:38:57 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 17:38:57 +0000
commitdb537c5181a7b8497740a095975841b2dd7b1420 (patch)
treea3a893a9f21f079624846ef7ceba4bdfbce9750b
parent1513550611dec783397fb307f74948de2fd10e44 (diff)
* 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/trunk@45144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/resolv.rb4
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c1032232d9..89ec084073 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Feb 23 02:19:51 2014 Tanaka Akira <akr@fsij.org>
+
+ * 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]
+
Sat Feb 22 23:17:01 2014 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/xpath_parser.rb: Fix indent.
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 2789aa1c12..7b2f7f031c 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -652,7 +652,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