dotnet / dotnet/arcade

SignTool will fail to preserve unix file modes in certain configurations

Open
#16,273 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

In certain cases, SignTool will fail to preserve unix file modes when repacking archives. This can happen in various cases, but have the same general shape: Before repacking, a file is replaced in a layout **on disk** and that file does not have the correct Unix file modes, the repacked archive could have the wrong unix file mode. Examples:

- [ ] If the tool is running on netframework (on Windows), unpacking a tar.gz will hydrate files on disk. The file mode would not be preserved. On repack, files are copied to the layout, then a netcore hosted tool is used to repack.
- [x] On MacOS, repacking copies files to the layout. If two identical binaries are in a nupkg and a pkg and the nupkg is unpacked first, the file modes are carried in the pkg format but not the nupkg (zip). The hydrated file on disk will have no modes, but will be fine because we don't expect that in the zip. The pkg though carries the file modes, and when the file is copied to the pkg before repack it'll lose its required file modes.

This is an area where we need to make the testing more robust if we are to support a variety of usage scenarios.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.