ruby-changes:19600
From: kosaki <ko1@a...>
Date: Thu, 19 May 2011 21:18:48 +0900 (JST)
Subject: [ruby-changes:19600] kosaki:r31643 (trunk): revert O_CLOEXEC patch series completely.
kosaki 2011-05-19 21:18:41 +0900 (Thu, 19 May 2011) New Revision: 31643 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31643 Log: 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. Modified files: trunk/ChangeLog trunk/io.c trunk/test/ruby/test_io.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 31642) +++ ChangeLog (revision 31643) @@ -111,10 +111,6 @@ * lib/singleton.rb: Improve documentation. Patch by Pete Higgins. [Ruby 1.9 - Bug #4709] -Wed May 18 01:02:53 2011 KOSAKI Motohiro <kosaki.motohiro@g...> - - * test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): add null check. - Tue May 17 21:24:04 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * thread.c (rb_mutex_lock): remove remove_signal_thread_list() call. @@ -794,11 +790,6 @@ * ext/syck/rubyext.c (mktime_do): YAML.load time correctly parse usecs smaller than 1 fixes #4571 -Thu May 5 23:08:32 2011 KOSAKI Motohiro <kosaki.motohiro@g...> - - * test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): fix false positive - detection. - Thu May 5 22:23:34 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * thread_pthread.c (native_mutex_reinitialize_atfork): removed @@ -839,12 +830,6 @@ * benchmark/bm_io_select2.rb: reduce number of using file descriptors. because gdb need some fds. -Wed May 4 20:22:12 2011 KOSAKI Motohiro <kosaki.motohiro@g...> - - * io.c (Init_IO): Added File::CLOEXEC constant. - [ruby-core:22893] [Feature #1291] - * test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC. - Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * thread.c (rb_wait_for_single_fd): Fix wrong return value. Index: io.c =================================================================== --- io.c (revision 31642) +++ io.c (revision 31643) @@ -10573,10 +10573,6 @@ /* Try to minimize cache effects of the I/O to and from this file. */ rb_file_const("DIRECT", INT2FIX(O_DIRECT)); #endif -#ifdef O_CLOEXEC - /* enable close-on-exec flag */ - rb_file_const("CLOEXEC", INT2FIX(O_CLOEXEC)); /* Linux, POSIX-2008. */ -#endif sym_mode = ID2SYM(rb_intern("mode")); sym_perm = ID2SYM(rb_intern("perm")); Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 31642) +++ test/ruby/test_io.rb (revision 31643) @@ -1238,57 +1238,6 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/