You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Trung Pham (Jira)" <ji...@apache.org> on 2021/03/26 13:05:00 UTC

[jira] [Updated] (IO-727) FilenameUtils.directoryContains() and FileUtils.directoryContains() return wrong result when parent and child have the same path prefix

     [ https://issues.apache.org/jira/browse/IO-727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trung Pham updated IO-727:
--------------------------
           Description: 
FilenameUtils.directoryContains() and FileUtils.directoryContains() will return `true` with the following input.
{code:java}
canonicalParent: /path/foo
canonicalChild:  /path/foobar
{code}
There were several issues on this but the problem still remains.
 IO-423 didn't do anything.
 IO-466 test case added in [676c03|https://github.com/apache/commons-io/commit/67325cf97946f053da51dd358a9ffca0a9676c03] just happened to passed because the input file didn't exist.
Github PR: https://github.com/apache/commons-io/pull/217

  was:
FilenameUtils.directoryContains() and FileUtils.directoryContains() will return `true` with the following input.
{code:java}
canonicalParent: /path/foo
canonicalChild:  /path/foobar
{code}
There were several issues on this but the problem still remains.
 IO-423 didn't do anything.
 IO-466 test case added in [676c03|https://github.com/apache/commons-io/commit/67325cf97946f053da51dd358a9ffca0a9676c03] just happened to passed because the input file didn't exist.
I'll try to make a PR with tests to demonstrate the bug.

    Remaining Estimate:     (was: 0h)

> FilenameUtils.directoryContains() and FileUtils.directoryContains() return wrong result when parent and child have the same path prefix
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IO-727
>                 URL: https://issues.apache.org/jira/browse/IO-727
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>            Reporter: Trung Pham
>            Priority: Major
>          Time Spent: 10m
>
> FilenameUtils.directoryContains() and FileUtils.directoryContains() will return `true` with the following input.
> {code:java}
> canonicalParent: /path/foo
> canonicalChild:  /path/foobar
> {code}
> There were several issues on this but the problem still remains.
>  IO-423 didn't do anything.
>  IO-466 test case added in [676c03|https://github.com/apache/commons-io/commit/67325cf97946f053da51dd358a9ffca0a9676c03] just happened to passed because the input file didn't exist.
> Github PR: https://github.com/apache/commons-io/pull/217



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