From 898374126e2c2632bc9bf0308407898af1f4ff82 Mon Sep 17 00:00:00 2001 From: kosaki Date: Thu, 19 May 2011 12:18:41 +0000 Subject: revert O_CLOEXEC patch series completely. because boron chkbuild test result says, An old linux kernel ignore O_CLOEXEC silently instead of return an error. It may lead to bring new security risk. So, we have to be pending it until finish to implement proper fallback logic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index f5f49f3efa..de55abbd41 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1238,57 +1238,6 @@ class TestIO < Test::Unit::TestCase end end - def test_O_CLOEXEC - if !defined? File::CLOEXEC - return - end - - mkcdtmpdir do - ary = [] - begin - 10.times { - ary.concat IO.pipe - } - - normal_file = Tempfile.new("normal_file"); - assert_equal(false, normal_file.close_on_exec?) - cloexec_file = Tempfile.new("cloexec_file", :mode => File::CLOEXEC); - assert_equal(true, cloexec_file.close_on_exec?) - arg, argw = IO.pipe - argw.puts normal_file.fileno - argw.puts cloexec_file.fileno - argw.flush - ret, retw = IO.pipe - - while (e = ary.shift) != nil - e.close - end - - spawn("ruby", "-e", <<-'End', :close_others=>false, :in=>arg, :out=>retw) - begin - puts IO.for_fd(gets.to_i).fileno - puts IO.for_fd(gets.to_i).fileno - rescue - puts "nofile" - ensure - exit - end - End - retw.close - Process.wait - assert_equal("#{normal_file.fileno}\nnofile\n", ret.read) - ensure - while (e = ary.shift) != nil - e.close - end - arg.close unless !arg || arg.closed? - argw.close unless !argw || argw.closed? - ret.close unless !ret || ret.closed? - retw.close unless !retw || retw.closed? - end - end - end - def test_close_security_error with_pipe do |r, w| assert_raise(SecurityError) do -- cgit v1.2.3