diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-30 13:00:04 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-30 13:00:04 +0000 |
commit | 860e548a637a705b0d88b18cca14590d55264dcd (patch) | |
tree | 24e222dfcbcde48147a489cce7b9825dc2ff3325 | |
parent | c8f77d37bcc297af49106dfc398c94d4db867a17 (diff) |
merge revision(s) 67247: [Backport #15666]
Guard out the test when it is run under root permission
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/fileutils/test_fileutils.rb | 11 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 584a1f517a..521a712acb 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -701,6 +701,17 @@ class TestFileUtils < Test::Unit::TestCase remove_entry_secure 'tmp/tmpdir/c', true assert_file_not_exist 'tmp/tmpdir/a' assert_file_not_exist 'tmp/tmpdir/c' + + unless root_in_posix? + File.chmod(01777, 'tmp/tmpdir') + 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 + end + Dir.rmdir 'tmp/tmpdir' end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.6" #define RUBY_RELEASE_DATE "2019-04-30" -#define RUBY_PATCHLEVEL 161 +#define RUBY_PATCHLEVEL 162 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 4 |