(zipfs) ZipFileSystem should support Files.isSymbolicLink

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated: