From 5d6ca9e95058bac96140ef9394291fed08a76070 Mon Sep 17 00:00:00 2001 From: hsbt Date: Thu, 18 Jun 2015 14:21:03 +0000 Subject: * include/ruby/ruby.h: $SAFE=2 is now obsolete. * dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/erb/test_erb.rb | 1 - test/fiddle/test_handle.rb | 37 --------------------- test/ruby/test_env.rb | 81 ---------------------------------------------- 3 files changed, 119 deletions(-) (limited to 'test') diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index 150df1dc26..1f1253fd23 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -89,7 +89,6 @@ class TestERBCore < Test::Unit::TestCase _test_core(nil) _test_core(0) _test_core(1) - _test_core(2) end def _test_core(safe) diff --git a/test/fiddle/test_handle.rb b/test/fiddle/test_handle.rb index 2655b1c0cb..2480230829 100644 --- a/test/fiddle/test_handle.rb +++ b/test/fiddle/test_handle.rb @@ -14,15 +14,6 @@ module Fiddle assert_kind_of Integer, handle.to_i end - def test_static_sym_secure - assert_raises(SecurityError) do - Thread.new do - $SAFE = 2 - Fiddle::Handle.sym('calloc') - end.join - end - end - def test_static_sym_unknown assert_raises(DLError) { Fiddle::Handle.sym('fooo') } assert_raises(DLError) { Fiddle::Handle['fooo'] } @@ -66,16 +57,6 @@ module Fiddle assert_raises(TypeError) { handle[nil] } end - def test_sym_secure - assert_raises(SecurityError) do - Thread.new do - $SAFE = 2 - handle = Handle.new(LIBC_SO) - handle.sym('calloc') - end.join - end - end - def test_sym handle = Handle.new(LIBC_SO) refute_nil handle.sym('calloc') @@ -99,24 +80,6 @@ module Fiddle assert_instance_of Handle, dlopen(LIBC_SO) end - def test_dlopen_safe - assert_raises(SecurityError) do - Thread.new do - $SAFE = 2 - dlopen(LIBC_SO) - end.join - end - end - - def test_initialize_safe - assert_raises(SecurityError) do - Thread.new do - $SAFE = 2 - Handle.new(LIBC_SO) - end.join - end - end - def test_initialize_noargs handle = Handle.new refute_nil handle['rb_str_new'] diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index 541500a44f..6effa5197c 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -444,87 +444,6 @@ class TestEnv < Test::Unit::TestCase end end - def test_taint_aref - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV["FOO".taint] - end.call - end - end - - def test_taint_fetch - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.fetch("FOO".taint) - end.call - end - end - - def test_taint_assoc - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.assoc("FOO".taint) - end.call - end - end - - def test_taint_rassoc - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.rassoc("FOO".taint) - end.call - end - end - - def test_taint_key - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.key("FOO".taint) - end.call - end - end - - def test_taint_key_p - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.key?("FOO".taint) - end.call - end - end - - def test_taint_value_p - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV.value?("FOO".taint) - end.call - end - end - - def test_taint_aset_value - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV["FOO"] = "BAR".taint - end.call - end - end - - def test_taint_aset_key - assert_raise(SecurityError) do - proc do - $SAFE = 2 - ENV["FOO".taint] = "BAR" - end.call - end - end - if RUBY_PLATFORM =~ /bccwin|mswin|mingw/ def test_memory_leak_aset bug9977 = '[ruby-dev:48323] [Bug #9977]' -- cgit v1.2.3