Open BaerMitUmlaut opened 10 months ago
Tagging subscribers to this area: @dotnet/area-system-io-compression See info in area-owners.md if you want to be subscribed.
Author: | BaerMitUmlaut |
---|---|
Assignees: | - |
Labels: | `area-System.IO.Compression` |
Milestone: | - |
Also seeing this problem on Android when using ZipFileExtensions.ExtractToFile(ZipArchiveEntry, String)
.
The fix looks fairly easy:
_versionMadeByPlatform
field needs a public getter property:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs#L22I tried making a fix but was so far unable to get the tools completely running including a new test file, might try again later.
@BaerMitUmlaut thanks for trying to get a fix.
I tried making a fix but was so far unable to get the tools completely running including a new test file, might try again later.
Where were you blocked? Can we help unblock you?
I wonder if this issue is related to reparse points not being fully supported: https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-points
At least one of the reparse points indicates that a file is from OneDrive.
@dotnet/area-system-io have you folks worked with these files lately?
@dotnet/area-system-io have you folks worked with these files lately?
No, not really. But seems like P also means Sparse in older Windows versions https://superuser.com/questions/44812/windows-explorers-file-attribute-column-values/982721#982721.
The permissions should be -rw-r--r--, like any file that did not have the "pinned"
Are all other Windows attributes ignored when unzipping in Linux?
Are all other Windows attributes ignored when unzipping in Linux?
I don't know, but there might be more that influence it. This one was just the one I found in the wild on a production system.
Description
When unpacking certain ZIP files on Linux that were packed on Windows and had the "pinned" attribute set (example file),
ZipFile.ExtractToDirectory
will cause the file to only have execute permissions (------x---
).Reproduction Steps
attrib +p filename
/tmp
) using the following code:ls -l
:Expected behavior
The permissions should be
-rw-r--r--
, like any file that did not have the "pinned" attribute set when it was packed.Actual behavior
Read and write permissions are missing and an excutable permission is set (
------x---
).Regression?
No response
Known Workarounds
Repacking the ZIP through the Windows packing tools or unsetting the "pinned" flag fixes the problem but cannot be done through code.
Configuration
Other information
No response