Skip to content

SignTool will fail to preserve unix file modes in certain configurations #16273

@mmitche

Description

@mmitche

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.
  • 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.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions