Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8323608

(zipfs) ZipFileSystem should support Files.isSymbolicLink

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      The CEN header field "external file attributes" holds the Unix file type in the leading 4 bits, but this is not inquired by ZipFileSystem when ZipFileSystem.isSymbolicLink is called. Instead ZipFileSystem always returns false for this method.

      A ZIP file with a symbolic link can be created using Info-ZIP as follows:

      % touch source
      % ln -s source target
      % zip -y symlink.zip source target

      Here, the source file will have a Unix "external file attribute" of 0x81A4, while the target file has the value 0xA1ED, meaning leading 4 bits "1000" (regular file) vs "1010" (symbolic link).

      The solution is to update ZipFileSystem.Entry.isSymbolicLink to compare the leading 4 bits of posixPerms against 012.

            eirbjo Eirik Bjørsnøs
            eirbjo Eirik Bjørsnøs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: