-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Currently, TarEntry.cs, in GetFileTarHeader, trims all leading forward slashes.
Trying to write /home/username/foo.txt as an entry would to write home/username/foo.txt
This prevents writing absolute paths to the archive, and also breaks the RootPath string, as the entry name will no longer have the root path as a sub string (if it was set to /home/username), so it will never match when the entry is added to the archive.
If we're trying to specifically avoid UNC path names, it might be easier to just test for a leading double back slash in the original path (instead of testing for leading slashes).
Expected behavior
RootPath should work as expected when adding absolute paths on POSIX.
Actual behavior
RootPath does not work as expected - file strings will never match RootPath because RootPath will still contain the leading '/', but the file entry will not.
Additionally, absolute file paths will be broken, regardless if root path is used.
Version of SharpZipLib
1.1.0
Obtained from (only keep the relevant lines)
- Package installed using NuGet