mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Run r66972 assertion only when a sticky-bit makes sense
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb5a329814
commit
af83a85f75
1 changed files with 6 additions and 5 deletions
|
@ -742,13 +742,14 @@ class TestFileUtils < Test::Unit::TestCase
|
|||
assert_file_not_exist 'tmp/tmpdir/c'
|
||||
|
||||
File.chmod(01777, 'tmp/tmpdir')
|
||||
Dir.mkdir 'tmp/tmpdir/d', 0
|
||||
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
|
||||
File.chmod 0777, 'tmp/tmpdir/d'
|
||||
Dir.rmdir 'tmp/tmpdir/d'
|
||||
if File.sticky?('tmp/tmpdir')
|
||||
Dir.mkdir 'tmp/tmpdir/d', 0
|
||||
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
|
||||
File.chmod 0777, 'tmp/tmpdir/d'
|
||||
Dir.rmdir 'tmp/tmpdir/d'
|
||||
end
|
||||
|
||||
Dir.rmdir 'tmp/tmpdir'
|
||||
|
||||
end
|
||||
|
||||
def test_remove_entry_secure_symlink
|
||||
|
|
Loading…
Reference in a new issue