commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-319) FileUtils.sizeOfDirectory follows symbolic links.
Date Mon, 09 Apr 2012 12:05:18 GMT

    [ https://issues.apache.org/jira/browse/IO-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249792#comment-13249792
] 

Gary D. Gregory commented on IO-319:
------------------------------------

Can you provide a patch for [io] trunk please?
                
> FileUtils.sizeOfDirectory follows symbolic links.
> -------------------------------------------------
>
>                 Key: IO-319
>                 URL: https://issues.apache.org/jira/browse/IO-319
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Ravi Prakash
>            Priority: Critical
>
> First of all Thanks tons Apache Commons folks for all the amazing work! :) My first JIRA.
Yayyy. I contributed B-)
> A symbolic link may create a cycle and so sizeOfDirectory crashes with an IllegalArgumentException.
e.g. 
> {noformat}
> $ tree test
> test
> ├── file
> └── ravi
>     ├── cycle -> ../../test
>     └── file
> {noformat}
> causes FileUtils.sizeOfDirectory to crash like so
> {noformat}
> java TestJAVA
> Exception in thread "main" java.lang.IllegalArgumentException: <somepath>/test/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle/ravi/cycle
does not exist
>         at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2053)
>         at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2089)
>         at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2057)
>         at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2089)
>         at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2057)
>         at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2089)
>         at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2057)
>         at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2089)
> {noformat}
> We faced the same issue in Hadoop :(. Checkout https://issues.apache.org/jira/browse/HADOOP-6963
for our solution

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message