-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Compression.ZipFile support for Unix Permissions #1548
Copy link
Copy link
Closed
Labels
Cost:MWork that requires one engineer up to 2 weeksWork that requires one engineer up to 2 weeksPriority:3Work that is nice to haveWork that is nice to haveapi-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.IO.Compressionhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsos-linuxLinux OS (any supported distro)Linux OS (any supported distro)os-mac-os-xmacOS aka OSXmacOS aka OSX
Milestone
Metadata
Metadata
Assignees
Labels
Cost:MWork that requires one engineer up to 2 weeksWork that requires one engineer up to 2 weeksPriority:3Work that is nice to haveWork that is nice to haveapi-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.IO.Compressionhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsos-linuxLinux OS (any supported distro)Linux OS (any supported distro)os-mac-os-xmacOS aka OSXmacOS aka OSX
Type
Fields
Give feedbackNo fields configured for issues without a type.
Split from dotnet/corefx#17067
Proposal
We should add support in the Unix ZipFile for working with zips that contain entries with associated file permissions information. Right now the only way to capture or check the permissions info of an entry is to do some manual bit shifting of the
ExternalAttributesfield. We can do better than that.Wanting your zips to unzip with the same permissions they were zipped with is a very common scenario that we do not currently support. I propose that we do two things:
New API
Implementation
The follow-through here is relatively easy - stat files on creation, chmod them on extraction. The somewhat bothersome part is that we will need to make the System.IO.Compression.ZipFile assembly platform-specific because the new permissions support will be Unix-only.
Work-in-Progress solution available here: https://github.com/ianhays/corefx/commits/zipfile_perms
Benefit
Zips created using ZipFile on Unix will be usable interchangeably with those created using the
zipcommand as far as permissions are concerned. Using ZipFile to unzip zips created withzipwill create files that have the same permissions as they were created with. Makes our Unix users happy. @eerhardt is happy.PTAL: @stephentoub @JeremyKuhne @terrajobst @eerhardt @ViktorHofer