mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
4ae55eb1c0
commit
898374126e
3 changed files with 0 additions and 70 deletions
15
ChangeLog
15
ChangeLog
|
|
@ -111,10 +111,6 @@ Wed May 18 03:03:07 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
* lib/singleton.rb: Improve documentation. Patch by Pete Higgins.
|
* lib/singleton.rb: Improve documentation. Patch by Pete Higgins.
|
||||||
[Ruby 1.9 - Bug #4709]
|
[Ruby 1.9 - Bug #4709]
|
||||||
|
|
||||||
Wed May 18 01:02:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
|
||||||
|
|
||||||
* test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): add null check.
|
|
||||||
|
|
||||||
Tue May 17 21:24:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Tue May 17 21:24:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* thread.c (rb_mutex_lock): remove remove_signal_thread_list() call.
|
* thread.c (rb_mutex_lock): remove remove_signal_thread_list() call.
|
||||||
|
|
@ -794,11 +790,6 @@ Fri May 6 14:25:53 2011 Tinco Andringa <mail@tinco.nl>
|
||||||
* ext/syck/rubyext.c (mktime_do): YAML.load time correctly parse
|
* ext/syck/rubyext.c (mktime_do): YAML.load time correctly parse
|
||||||
usecs smaller than 1 fixes #4571
|
usecs smaller than 1 fixes #4571
|
||||||
|
|
||||||
Thu May 5 23:08:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
|
||||||
|
|
||||||
* test/ruby/test_io.rb (TestIO#test_O_CLOEXEC): fix false positive
|
|
||||||
detection.
|
|
||||||
|
|
||||||
Thu May 5 22:23:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Thu May 5 22:23:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* thread_pthread.c (native_mutex_reinitialize_atfork): removed
|
* thread_pthread.c (native_mutex_reinitialize_atfork): removed
|
||||||
|
|
@ -839,12 +830,6 @@ Wed May 4 21:11:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
* benchmark/bm_io_select2.rb: reduce number of using file
|
* benchmark/bm_io_select2.rb: reduce number of using file
|
||||||
descriptors. because gdb need some fds.
|
descriptors. because gdb need some fds.
|
||||||
|
|
||||||
Wed May 4 20:22:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
|
||||||
|
|
||||||
* 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@gmail.com>
|
Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* thread.c (rb_wait_for_single_fd): Fix wrong return value.
|
* thread.c (rb_wait_for_single_fd): Fix wrong return value.
|
||||||
|
|
|
||||||
4
io.c
4
io.c
|
|
@ -10573,10 +10573,6 @@ Init_IO(void)
|
||||||
/* Try to minimize cache effects of the I/O to and from this file. */
|
/* Try to minimize cache effects of the I/O to and from this file. */
|
||||||
rb_file_const("DIRECT", INT2FIX(O_DIRECT));
|
rb_file_const("DIRECT", INT2FIX(O_DIRECT));
|
||||||
#endif
|
#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_mode = ID2SYM(rb_intern("mode"));
|
||||||
sym_perm = ID2SYM(rb_intern("perm"));
|
sym_perm = ID2SYM(rb_intern("perm"));
|
||||||
|
|
|
||||||
|
|
@ -1238,57 +1238,6 @@ class TestIO < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
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
|
def test_close_security_error
|
||||||
with_pipe do |r, w|
|
with_pipe do |r, w|
|
||||||
assert_raise(SecurityError) do
|
assert_raise(SecurityError) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue