boris-unckel commented on a change in pull request #195:
URL: https://github.com/apache/commons-io/pull/195#discussion_r566680956
##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -1232,12 +1233,16 @@ public static boolean deleteQuietly(final File file) {
if (file.isDirectory()) {
cleanDirectory(file);
}
+ } catch (final SecurityException sec) {
Review comment:
@garydgregory This is a important one.
In general: A single JavaDoc should not override global design principles.
The SecurityManager has cross functional purpose. [Edit:] I agree that the
missing documentation to throw a SecurityExcpetion is necessary. My fault, will
correct that.
UseCase A: One wants to configure the SecurityManager and grant permissions.
Part of the application is to delete a file. If the permission is missing,
cleaning does not work. The missing exception does not allow to recognize that.
UseCase B: One has activated the SecurityManager. An attacker abuses the
deleteQuietly method. The missing SecurityException hides this attempt, you're
IDS can't alarm.
UseCase C: One utilizes the SecurityManager to test the system, to ensure
every property (like file location) is set properly. The missing
SecurityException does not support this UseCase.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]