diff options
author | Martin Polden <mpolden@mpolden.no> | 2022-04-04 11:47:05 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2022-04-04 15:26:43 +0200 |
commit | 0299283478780a058eb21055c710ee7511b5b5f3 (patch) | |
tree | 03ab27cc01b03685954a4840245527578959ac51 /vespajlib/src | |
parent | 102a38f3c99bda92ef883d3fe5ff3d81ec7675d3 (diff) |
Explain limits of symlink detection
Diffstat (limited to 'vespajlib/src')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/compress/ArchiveStreamReader.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/compress/ArchiveStreamReader.java b/vespajlib/src/main/java/com/yahoo/compress/ArchiveStreamReader.java index 9b60518e7b6..77dd49862ff 100644 --- a/vespajlib/src/main/java/com/yahoo/compress/ArchiveStreamReader.java +++ b/vespajlib/src/main/java/com/yahoo/compress/ArchiveStreamReader.java @@ -133,9 +133,14 @@ public class ArchiveStreamReader implements AutoCloseable { } private static boolean isSymlink(ArchiveEntry entry) { + // Symlinks inside ZIP files are not part of the ZIP spec and are only supported by some implementations, such + // as Info-ZIP. + // + // Commons Compress only has limited support for symlinks as they are only detected when the ZIP file is read + // through org.apache.commons.compress.archivers.zip.ZipFile. This is not the case in this class, because it must + // support reading ZIP files from generic input streams. The check below thus always returns false. if (entry instanceof ZipArchiveEntry) return ((ZipArchiveEntry) entry).isUnixSymlink(); if (entry instanceof TarArchiveEntry) return ((TarArchiveEntry) entry).isSymbolicLink(); - // TODO: Add workaround for the poor symlink handling in compress library throw new IllegalArgumentException("Unsupported archive entry " + entry.getClass().getSimpleName() + ", cannot check for symbolic link"); } |