RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v4]

Alan Bateman Alan.Bateman at oracle.com
Fri Jul 2 18:29:19 UTC 2021


On 02/07/2021 18:16, Lance Andersen wrote:
> :
>
> That being said, if we want to follow Alan’s suggestion and throw an Exception, I am OK with that as well.
>
> Either way, we currently cannot access the file via Zip FS due to the call to ZipPath::getResolvedPath() for all access and the path is only normalized when the Inodes are created.
>
> Alan, do you have a specific preference?
>
Not yet but if you tolerate these hostile entries then it means that all 
access with relative paths containing a "." or ".." element will be 
ambiguous. It will break relativize, normalize, and maybe other path 
operations. I assume it will break copy/move operations when the source 
is in a zip file and the target is in a non-zip file. I suspect it would 
also need to encode file names when open zip file for read/write access 
because the native file system is used for caching.

-Alan


More information about the core-libs-dev mailing list