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

ruby-changes:46610

From: normal <ko1@a...>
Date: Mon, 15 May 2017 16:33:16 +0900 (JST)
Subject: [ruby-changes:46610] normal:r58725 (trunk): test/socket/test_basicsocket.rb (socks): bind explicitly to localhost

normal	2017-05-15 16:33:10 +0900 (Mon, 15 May 2017)

  New Revision: 58725

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58725

  Log:
    test/socket/test_basicsocket.rb (socks): bind explicitly to localhost
    
    Binding to a potentially public IP in a test can cause problems
    if hit by a random port scanner or something...

  Modified files:
    trunk/test/socket/test_basicsocket.rb
Index: test/socket/test_basicsocket.rb
===================================================================
--- test/socket/test_basicsocket.rb	(revision 58724)
+++ test/socket/test_basicsocket.rb	(revision 58725)
@@ -98,7 +98,7 @@ class TestSocket_BasicSocket < Test::Uni https://github.com/ruby/ruby/blob/trunk/test/socket/test_basicsocket.rb#L98
   end
 
   def socks
-    sserv = TCPServer.new(0)
+    sserv = TCPServer.new('localhost', 0)
     ssock = nil
     t = Thread.new { ssock = sserv.accept }
     csock = TCPSocket.new('localhost', sserv.addr[1])

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

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