SharpZipLib
SharpZipLib copied to clipboard
Fix Issue #337 and Partially Fix #338
Removes GetCurrentDirectory checks from TarEntry, ensuring that behavior of adding files is consistent, regardless of the current assembly location (resolves #337).
Also removes the check for leading slashes, which prevents absolute paths on POSIX systems from being properly stored. This partially fixes #338, but not completely, as it also means UNC paths are unblocked (an unintended side effect of the fix).
I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.
It should be possible to fix this without allowing absolute paths. If we really want to add support for them, they should have to be explicitly be turned on since they are usually not intended or wanted (GNU tar strips them if not -P
is supplied). The fact that this also allows creating files UNC paths makes it even less of a good idea. Whether intentional or not, the consequences of such entries could cause all kinds of issues.
The name "cleaning" should of course be done in the same name on both sides of the equality check.