Project

General

Profile

Actions

Bug #4846

closed

Permission denied - /tmp/nonexisting

Added by znz (Kazuhiro NISHIYAMA) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3dev (2011-06-06 trunk 31944) [x86_64-linux]
Backport:
[ruby-dev:43640]

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 1 (0 open1 closed)

Related to Ruby master - Feature #1081: add File::write() convenience methodClosedmame (Yusuke Endoh)02/01/2009Actions
Actions #1

Updated by znz (Kazuhiro NISHIYAMA) almost 13 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]
Actions

Also available in: Atom PDF

Like0
Like0