[ 
https://issues.apache.org/jira/browse/IO-710?focusedWorklogId=544148&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-544148
 ]

ASF GitHub Bot logged work on IO-710:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Jan/21 09:17
            Start Date: 29/Jan/21 09:17
    Worklog Time Spent: 10m 
      Work Description: 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.
   
   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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 544148)
    Time Spent: 0.5h  (was: 20m)

> Utilize java.io.UncheckedIOException, rethrow SecurityException
> ---------------------------------------------------------------
>
>                 Key: IO-710
>                 URL: https://issues.apache.org/jira/browse/IO-710
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.8.0
>            Reporter: Boris Unckel
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Some methods catch IOExceptions and rethrow them in other RuntimeException 
> based exceptions (IllegalStateException, IllegalArgumentException).
> The JRE offers a standard for this usecase: java.io.UncheckedIOException
> In one case a SecurityException would be hidden. This is awfull if you're 
> trying to find the right set of permissions to make the SecurityManager work. 
> The default must be to rethrow them.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to