mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
tar extraction doesn't preserve file permissions #262
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MichaelJCompton on GitHub (Dec 6, 2017).
v0.18.2, netcoreapp2.0 on linux/mac,
tar contains
result of extraction is
(
PreserveAttributesoption toExtractionOptionsnot implemented)@adamhathcock commented on GitHub (Dec 7, 2017):
Applying file permissions is kind of out of scope. The file extraction methods are just convenience.
@pauldotknopf commented on GitHub (Apr 12, 2019):
I don't mind extracting the files myself, but there is currently no way to get what the file permissions should be.
I think they should at least be exposed in the
TarHeaderso that implementors can choose to use mode/user/group if they choose.https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Tar/Headers/TarHeader.cs#L121
@adamhathcock commented on GitHub (Apr 13, 2019):
Sounds like a good PR to me :)
@Ryhon0 commented on GitHub (Apr 10, 2022):
5 years later, there seems to be code for reading the permissions but is commented out, using
PreserveAttributesthrowsNotImplementedException.If setting permissions is out of the scope, can we please get a delegate for setting permissions, just like we have for creating symlinks?
Since UNIX permissions might not apply for Windows, alternatively just make the permission properties public and let the developers handle it in the
ExtractAllEntriesloop@adamhathcock commented on GitHub (Apr 11, 2022):
Sounds like a good PR to me :)
@Ryhon0 commented on GitHub (Apr 11, 2022):
No idea if that is the correct way to implement it.
Can be tested with following code:
@adamhathcock commented on GitHub (Apr 11, 2022):
Thanks for the PR!