[前][次][番号順一覧][スレッド一覧]

ruby-changes:33065

From: akr <ko1@a...>
Date: Sun, 23 Feb 2014 02:39:03 +0900 (JST)
Subject: [ruby-changes:33065] akr:r45144 (trunk): * lib/resolv.rb (bind_random_port): Rescue EPERM for FreeBSD which

akr	2014-02-23 02:38:57 +0900 (Sun, 23 Feb 2014)

  New Revision: 45144

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45144

  Log:
    * 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]

  Modified files:
    trunk/ChangeLog
    trunk/lib/resolv.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45143)
+++ ChangeLog	(revision 45144)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Feb 23 02:19:51 2014  Tanaka Akira  <akr@f...>
+
+	* 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@c...>
 
 	* lib/rexml/xpath_parser.rb: Fix indent.
Index: lib/resolv.rb
===================================================================
--- lib/resolv.rb	(revision 45143)
+++ lib/resolv.rb	(revision 45144)
@@ -652,7 +652,9 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L652
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]