Skip to content

Commit 67e91da

Browse files
committed
[IO-751] When deleting symlinks, File/PathUtils.deleteDirectory()
changes file permissions of the target. POSIX: Deleting a file requires write and execute on the parent. Listing a file also requires reading.
1 parent 4d81c42 commit 67e91da

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ public void testCleanDirectoryToForceDelete() throws Exception {
104104
final File file = new File(tempDirFile, "restricted");
105105
FileUtils.touch(file);
106106

107-
assumeTrue(chmod(tempDirFile, 500, false));
107+
// 300 = owner: WE.
108+
// 500 = owner: RE.
109+
// 700 = owner: RWE.
110+
assumeTrue(chmod(tempDirFile, 700, false));
108111

109112
// cleanDirectory calls forceDelete
110113
FileUtils.cleanDirectory(tempDirFile);

0 commit comments

Comments
 (0)