mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Consider calls to setReadable(false, false) then setReadable(true, true) to be safe
This commit is contained in:
@@ -263,4 +263,10 @@ public class Test {
|
||||
// TO MAKE SAFE REWRITE TO:
|
||||
Files.createDirectories(tempDirChild.toPath(), PosixFilePermissions.asFileAttribute(EnumSet.of(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE)));
|
||||
}
|
||||
|
||||
void safeFileCreationWithPermissions() throws IOException {
|
||||
File tempFile = File.createTempFile("temp", "file.txt");
|
||||
tempFile.setReadable(false, false);
|
||||
tempFile.setReadable(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user