The CSR for JDK-8251329 , is the same as the original CSR (https://bugs.openjdk.java.net/browse/JDK-8271294) for release 11u.
Summary
A zip or JAR file containing "." or ".." entries cannot be reliably used as a file system. Change the zip file system provider to reject attempts to open an existing zip or JAR file that contains these entries. An attempt to open a zip file as a file system with the java.nio.file.FileSystems API may therefore fail with an exception, a behavior change from existing releases.
Problem
As Zip FS is a virtual file system, it needs to use "." and ".." as links to the current and parent directories. Because of this, Zip FS cannot reliably support entries that have "." and ".." as name elements.
Having Zip entries such as "../Hello.txt" or "foo/./bar", ".", or ".." introduce inconsistencies for Zip FS. One such example is the use of Files::walk or Files::walkFileTree which will continue until memory is exhausted.
Solution
When opening a Zip File and encountering a Zip Entry containing an "." or ".." name element, a Zip Exception will be thrown with the message:
"ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"
Specification
We will update the follow section of the Zip FS module info:
Accessing a Zip File System
The FileSystems newFileSystem static factory methods can be used to:
- Create a Zip file system
- Open an existing file as a Zip file system
Note: The Zip File System will throw a ZipException when opening an existing Zip file that contains Zip entries with "." or ".." in its name elements.
- csr of
-
JDK-8274726 (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside
-
- Resolved
-
-
JDK-8278333 (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside
-
- Resolved
-