Bug #4846

Permission denied - /tmp/nonexisting

Added by Kazuhiro NISHIYAMA about 4 years ago. Updated about 4 years ago.

[ruby-dev:43640]
Status:Closed
Priority:Normal
Assignee:Kazuhiro NISHIYAMA
ruby -v:ruby 1.9.3dev (2011-06-06 trunk 31944) [x86_64-linux] Backport:

Description

=begin
なぜか chkbuild が所有者になっている /tmp/nonexisting というファイルが存在していて、
test_s_binwrite(TestIO) と test_s_write(TestIO) が以下の Failure になります。

[Errno::EINVAL] exception expected, not
Class: Errno::EACCES
Message: <"Permission denied - /tmp/nonexisting">

基本的には (Tempfile や Tmpdir 以外で) ファイルを作成するなら ensure で確実に削除してください。

そもそも /tmp 決め打ちでファイルを読み書きしないでください。

プラットフォームによっては /tmp がなかったり、/tmp があっても symlink attack の危険があったり、複数のユーザで同時に test-all を実行したときに問題が起きたりすると思います。

=end


Related issues

Related to Ruby trunk - Feature #1081: add File::write() convenience method Closed 02/01/2009

Associated revisions

Revision 31945
Added by kazu about 4 years ago

  • test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a file under /tmp. [Bug #4846]

Revision 31945
Added by kazu about 4 years ago

  • test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a file under /tmp. [Bug #4846]

History

#1 Updated by Kazuhiro NISHIYAMA about 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r31945.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a file under /tmp. [Bug #4846]

Also available in: Atom PDF