You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Apostolos Lerios (JIRA)" <ji...@apache.org> on 2008/05/05 19:03:55 UTC

[jira] Created: (IO-168) Symbolic links (symlinks) follows when deleting directory.

Symbolic links (symlinks) follows when deleting directory.
----------------------------------------------------------

                 Key: IO-168
                 URL: https://issues.apache.org/jira/browse/IO-168
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.4
         Environment: Linux only (symlinks required for bug to manifest)
            Reporter: Apostolos Lerios


If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:

1) the contents of 'dir' are emptied (the link is followed).
2) 'dir' continues to exist (but is empty).
3) 'dlink' is removed.

The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved IO-168.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.5)
                   2.0
         Assignee: Niall Pemberton

Thanks for testing, marking as resolved.

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Apostolos Lerios (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apostolos Lerios reopened IO-168:
---------------------------------


The issue is very close to being resolved. Attila's suggestion was near perfect. It has the following problem though:

If File f was constructed using a relative path (e.g. new File("dir") where dir is a directory within the current one), then getParent() will return null. So far so good. However, if dir is a directory whose ancestors include folders with long names (e.g. "Documents and Settings"), then under 1.6.0_14 on Windows XP SP3, the canonical path is something like

C:\Documents and Settings\Administrator\Desktop\test\directory

And the absolute path is something like

c:\DOCUME~1\Administrator\DESKTOP\tst\directory

They are unequal, so isSymlink will return true. Which is incorrect. To avoid this problem, we should obtain f's canonical path before we try to get its parent. That is, inside isSymlink,

      file.getParent()

should be replaced with

      file.getCanonicalFile().getParent()

And similarly file.getParentFile() should become file.getCanonicalFile().getParentFile().

Doing this will ensure that we'll obtain f's parent, even if f is specified with a relative file name. This, combined with Attila's fix, will in turn result in f's canonical and absolute paths having a common prefix without oddities like the DOS names above somewhere in the ancestral hierarchy.

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved IO-168.
--------------------------------

    Resolution: Fixed

Apostolos thanks for your suggestion - I changed the method to always return false for Windows:

http://svn.apache.org/viewvc?view=revision&revision=1002416

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621413#action_12621413 ] 

Niall Pemberton commented on IO-168:
------------------------------------

Brydie, thanks for the patch and Attila for the solution. I have applied a slightly modified form, which includes null checks - which if you could run the tests would be great because I'm on windows :(

http://svn.apache.org/viewvc?view=rev&revision=684715
http://svn.apache.org/viewvc?view=rev&revision=684716



> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Brydie McCoy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621360#action_12621360 ] 

Brydie McCoy commented on IO-168:
---------------------------------

Hi Guys,

I an attempt to get this fix in sooner, I have written up a patch for FileUtils based on Attila's suggestions along with a whole bunch of tests.  I have only put the fix in for the regular deleteDirectory and not the deleteDirectoryOnExit method which I am assuming will probably need this check in it as well.

Hope it helps...

Cheers,
Brydie


> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Ajay Sridhar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615831#action_12615831 ] 

Ajay Sridhar commented on IO-168:
---------------------------------

Hi Guys,

Is there an update on this? This seems like a fairly severe bug,

Cheers,
Ajay.

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Apostolos Lerios (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apostolos Lerios updated IO-168:
--------------------------------

    Summary: Symbolic links (symlinks) followed when deleting directory.  (was: Symbolic links (symlinks) follows when deleting directory.)

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated IO-168:
-----------------------------

    Fix Version/s: 1.5

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>             Fix For: 1.5
>
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Apostolos Lerios (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781760#action_12781760 ] 

Apostolos Lerios edited comment on IO-168 at 11/24/09 3:54 AM:
---------------------------------------------------------------

The issue is very close to being resolved. Attila's suggestion was near perfect. It has the following problem though:

If File f was constructed using a relative path (e.g. new File("dir") where dir is a directory within the current one), then getParent() will return null. So far so good. However, if dir is a directory whose ancestors include folders with long names (e.g. "Documents and Settings"), then under 1.6.0_14 on Windows XP SP3, the canonical path is something like

C:\Documents and Settings\Administrator\Desktop\test\directory

And the absolute path is something like

c:\DOCUME~1\Administrator\DESKTOP\tst\directory

They are unequal, so isSymlink will return true. Which is incorrect. To avoid this problem, we should obtain f's absolute path before we try to get its parent. That is, inside isSymlink,

      file.getParent()

should be replaced with

      file.getAbsoluteFile().getParent()

And similarly file.getParentFile() should become file.getAbsoluteFile().getParentFile().

Doing this will ensure that we'll obtain f's parent, even if f is specified with a relative file name. This, combined with Attila's fix, will avoid oddities like the DOS names above somewhere in the ancestral hierarchy.

      was (Author: tlerios):
    The issue is very close to being resolved. Attila's suggestion was near perfect. It has the following problem though:

If File f was constructed using a relative path (e.g. new File("dir") where dir is a directory within the current one), then getParent() will return null. So far so good. However, if dir is a directory whose ancestors include folders with long names (e.g. "Documents and Settings"), then under 1.6.0_14 on Windows XP SP3, the canonical path is something like

C:\Documents and Settings\Administrator\Desktop\test\directory

And the absolute path is something like

c:\DOCUME~1\Administrator\DESKTOP\tst\directory

They are unequal, so isSymlink will return true. Which is incorrect. To avoid this problem, we should obtain f's canonical path before we try to get its parent. That is, inside isSymlink,

      file.getParent()

should be replaced with

      file.getCanonicalFile().getParent()

And similarly file.getParentFile() should become file.getCanonicalFile().getParentFile().

Doing this will ensure that we'll obtain f's parent, even if f is specified with a relative file name. This, combined with Attila's fix, will in turn result in f's canonical and absolute paths having a common prefix without oddities like the DOS names above somewhere in the ancestral hierarchy.
  
> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Apostolos Lerios (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601095#action_12601095 ] 

Apostolos Lerios commented on IO-168:
-------------------------------------

Yes. Here is how.

    public static final FileType get
        (File file)
    {
        if (file==null) {
            return UNKNOWN;
        }
        try {
            if (!file.exists()) {
                return NONEXISTENT;
            }
            if (file.getCanonicalFile().equals(file.getAbsoluteFile())) {
                if (file.isDirectory()) {
                    return DIR;
                }
                if (file.isFile()) {
                    return FILE;
                }
            } else {
                if (file.isDirectory()) {
                    return LINK_DIR;
                }
                if (file.isFile()) {
                    return LINK_FILE;
                }
            }
        } catch (IOException ex) {
           // CANNOT_GET_TYPE
        }
        return UNKNOWN;
    }


> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Brydie McCoy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621651#action_12621651 ] 

Brydie McCoy commented on IO-168:
---------------------------------

Thanks for that Niall, I knew there was something i was forgetting...  Anyway, I ran the tests on your changes and they are still passing!

Thanks again,
Brydie

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Brydie McCoy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brydie McCoy updated IO-168:
----------------------------

    Attachment: symlinkFix.patch

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>         Attachments: symlinkFix.patch
>
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Attila Szegedi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617409#action_12617409 ] 

Attila Szegedi commented on IO-168:
-----------------------------------

Folks,

file.getCanonicalFile().equals(file.getAbsoluteFile())

won't return true only for a symlink. It will also return true for a file that has at least one symlinked directory in its path.

This will work as expected though:

File canonicalDir = file.getParentFile().getCanonicalFile();
File fileInCanonicalDir = new File(canonicalDir, file.getName());
return fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());

Attila.

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IO-168) Symbolic links (symlinks) followed when deleting directory.

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601087#action_12601087 ] 

Niall Pemberton commented on IO-168:
------------------------------------

Is there any way to determine a file is a symlink?

> Symbolic links (symlinks) followed when deleting directory.
> -----------------------------------------------------------
>
>                 Key: IO-168
>                 URL: https://issues.apache.org/jira/browse/IO-168
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4
>         Environment: Linux only (symlinks required for bug to manifest)
>            Reporter: Apostolos Lerios
>
> If 'dlink' is a symbolic link to a directory 'dir', and FileUtils.forceDelete is called on dlink, then here is what happens:
> 1) the contents of 'dir' are emptied (the link is followed).
> 2) 'dir' continues to exist (but is empty).
> 3) 'dlink' is removed.
> The correct behavior is to simply remove 'dlink' without following it and thus without altering the contents of 'dir' (or 'dir' itself).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.