summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-19 12:18:41 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-19 12:18:41 +0000
commit898374126e2c2632bc9bf0308407898af1f4ff82 (patch)
tree32ca46094134a1699982fd0db09f19a0f0e59079 /test/ruby
parent4ae55eb1c00889ccf923b2983229e556d7268484 (diff)
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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb51
1 files changed, 0 insertions, 51 deletions
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