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

ASF GitHub Bot logged work on HADOOP-17683:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/May/21 11:24
            Start Date: 20/May/21 11:24
    Worklog Time Spent: 10m 
      Work Description: haiyang1987 commented on a change in pull request #2974:
URL: https://github.com/apache/hadoop/pull/2974#discussion_r635970022



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
##########
@@ -604,18 +604,12 @@ public static long getDU(File dir) {
       return dir.length();
     } else {
       File[] allFiles = dir.listFiles();
-      if(allFiles != null) {
-         for (int i = 0; i < allFiles.length; i++) {
-           boolean isSymLink;
-           try {
-             isSymLink = 
org.apache.commons.io.FileUtils.isSymlink(allFiles[i]);
-           } catch(IOException ioe) {
-             isSymLink = true;
-           }
-           if(!isSymLink) {
-             size += getDU(allFiles[i]);
-           }
-         }
+      if (allFiles != null) {
+        for (File f : allFiles) {
+          if (!org.apache.commons.io.FileUtils.isSymlink(f)) {

Review comment:
       Should try catch  performed here ?




-- 
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 599751)
    Time Spent: 40m  (was: 0.5h)

> Update commons-io to 2.8.0
> --------------------------
>
>                 Key: HADOOP-17683
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17683
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: Wei-Chiu Chuang
>            Assignee: Akira Ajisaka
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.3.1, 3.4.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> https://nvd.nist.gov/vuln/detail/CVE-2021-29425
> In Apache Commons IO before 2.7, When invoking the method 
> FileNameUtils.normalize with an improper input string, like "//../foo", or 
> "\\..\foo", the result would be the same value, thus possibly providing 
> access to files in the parent directory, but not further above (thus 
> "limited" path traversal), if the calling code would use the result to 
> construct a path value.
> We don't use this API in the Hadoop code, but it's still good to update 
> anyway (we're on 2.5, which is 4 years old)



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to