ruby-changes:25903
From: naruse <ko1@a...>
Date: Thu, 29 Nov 2012 10:21:14 +0900 (JST)
Subject: [ruby-changes:25903] naruse:r37960 (trunk): Revert r37953: thread.c (thread_start_func_2): remove unused code. security
naruse 2012-11-29 10:11:47 +0900 (Thu, 29 Nov 2012) New Revision: 37960 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37960 Log: Revert r37953: thread.c (thread_start_func_2): remove unused code. security This sticks at bootstraptest/test_fork.rb:24 on FreeBSD and darwin. http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20121128T230302Z.log.html.gz http://a.mrkn.jp/~mrkn/chkbuild/sl/ruby-trunk-m64-gcc42-o0/log/20121128T235908Z.log.html.gz Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37959) +++ ChangeLog (revision 37960) @@ -30,11 +30,6 @@ errinfo = th->errinfo; and errinfo = rb_errinfo(); are the same. -Thu Nov 29 06:24:15 2012 KOSAKI Motohiro <kosaki.motohiro@g...> - - * thread.c (thread_start_func_2): remove unused code. security - level is checked before rb_eSecurityError raises. - Thu Nov 29 05:26:32 2012 Koichi Sasada <ko1@a...> * vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary. Index: thread.c =================================================================== --- thread.c (revision 37959) +++ thread.c (revision 37960) @@ -491,8 +491,16 @@ if (state == TAG_FATAL) { /* fatal error within this thread, need to stop whole script */ } - else if (th->vm->thread_abort_on_exception || - th->abort_on_exception || RTEST(ruby_debug)) { + else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) { + if (th->safe_level >= 4) { + th->errinfo = rb_exc_new3(rb_eSecurityError, + rb_sprintf("Insecure exit at level %d", th->safe_level)); + errinfo = Qnil; + } + } + else if (th->safe_level < 4 && + (th->vm->thread_abort_on_exception || + th->abort_on_exception || RTEST(ruby_debug))) { /* exit on main_thread */ } else { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/