diff --git a/ChangeLog b/ChangeLog index 730969de43..0086aef6f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 12 13:34:25 2014 SHIBATA Hiroshi + + * lib/fileutils.rb: enable to remove with non-owner directory. + [ruby-dev:45976] [Bug #6756] + * test/fileutils/test_fileutils.rb: add testcase for #6756. + Tue Aug 12 12:57:28 2014 SHIBATA Hiroshi * vm_exec.c: improve performance in ppc64 arch. diff --git a/lib/fileutils.rb b/lib/fileutils.rb index d928e3b2d7..23fd19310a 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1489,6 +1489,7 @@ module FileUtils end end end + ensure yield self end diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index dd6f605ddb..9263fe0180 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -1499,6 +1499,14 @@ class TestFileUtils < Test::Unit::TestCase def test_rm_rf check_singleton :rm_rf + + return if /mswin|mingw/ =~ RUBY_PLATFORM + + mkdir 'tmpdatadir' + chmod 700, 'tmpdatadir' + rm_rf 'tmpdatadir' + + assert_file_not_exist 'tmpdatadir' end def test_rmdir