ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikiran Pai <jai.forums2...@gmail.com>
Subject Re: FileUtils.normalize/isLeadingPath have bitten me
Date Mon, 02 Jul 2018 07:52:19 GMT
Hi Stefan,

Sorry that I couldn't get to this earlier. My plan to spend more time on 
this during the weekend didn't work out.

I just checked the commits related to this and it looks mostly correct. 
However, I am still not 100% sure we have covered it all with this new 
method that was introduced[1] and used in the unzip part. What I mean 
is, the API expectations are right. However the implementation _might_ 
need a bit of rethink since it still relies on path string comparison 
(checks like endsWith) instead of a getParent() check. My suspicion is 
all theoretical at the moment and may not even be valid. I'm going to 
build the latest changes of Ant give it a try against a bunch of my 
theoretical use cases and see if my suspicions are really valid or not.

[1] 
https://github.com/apache/ant/commit/6a41d62cb9ab4e640b72cb4de42a6c211dea645d

-Jaikiran


On 01/07/18 2:57 PM, Stefan Bodewig wrote:
> On 2018-06-28, Stefan Bodewig wrote:
>
>> On 2018-06-28, Jaikiran Pai wrote:
>>> Which then makes me wonder - in the context of this specific
>>> untar/expand/unzip issue, should we probably be using a different
>>> custom very specific logic (which relies on canonical files and
>>> getParent()) instead of a call to isLeadingPath()?
>> Probably. I used isLeadingPath because it has been already there - and )
>> simply didn't realize it wouldn't do what I expected it to.
> I decided to "fix" isLeadingPath for this edge case and add a method
> using canonical paths instead - and use that in unzip and friends.
>
> Please have a look at the proposed solution, I won't close the Bugzilla
> issue before we have agreed this is the proper fix.
>
> Cheers
>
>          Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message