From cadee06b2a09c309b0fb944251a8105b449d7dd1 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 26 Jun 2009 12:48:15 +0000 Subject: [PATCH] * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt): test suite add '.' to RUBYLIB. remove checks. * test/ruby/test_require.rb (TestRequire#test_tainted_loadpath): the default tempdir directory /tmp is world writable, so SecrurityError would be raised. check removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ test/ruby/test_require.rb | 7 +++++-- test/ruby/test_rubyoptions.rb | 4 ---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b67bcf0647..ae4b884a45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Jun 26 17:33:46 2009 Yukihiro Matsumoto + + * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt): + test suite add '.' to RUBYLIB. remove checks. + + * test/ruby/test_require.rb (TestRequire#test_tainted_loadpath): + the default tempdir directory /tmp is world writable, so + SecrurityError would be raised. check removed. + Fri Jun 26 16:32:59 2009 NAKAMURA Usaku * common.mk (COMPILE_PRELUDE): need -I. before -rrbconfig. diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 4bc44eff04..a1726bf63b 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -230,8 +230,11 @@ class TestRequire < Test::Unit::TestCase abs_dir = "#{ abs_dir }" $: << abs_dir.taint $SAFE = 1 - require "#{ t.path }" - p :ok + begin + require "#{ file }" + rescue SecurityError + p :ok + end INPUT assert_in_out_err([], <<-INPUT, %w(:ok), []) diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 909c8f469e..59be99164a 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -199,16 +199,12 @@ class TestRubyOptions < Test::Unit::TestCase ENV['RUBYOPT'] = ' - -' assert_in_out_err([], "", [], []) - assert_in_out_err(['-e', 'p $:.include?(".")'], "", ["false"], []) - ENV['RUBYOPT'] = '-e "p 1"' assert_in_out_err([], "", [], /invalid switch in RUBYOPT: -e \(RuntimeError\)/) ENV['RUBYOPT'] = '-T1' assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/) - assert_in_out_err(['-e', 'p $:.include?(".")'], "", ["false"], []) - ENV['RUBYOPT'] = '-T4' assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/)