Skip to content

Fix SignTool crashes on containers with symbolic links #16518

Merged
MichaelSimons merged 10 commits intodotnet:mainfrom
MichaelSimons:symbolic-sign
Feb 13, 2026
Merged

Fix SignTool crashes on containers with symbolic links #16518
MichaelSimons merged 10 commits intodotnet:mainfrom
MichaelSimons:symbolic-sign

Conversation

@MichaelSimons
Copy link
Copy Markdown
Member

@MichaelSimons MichaelSimons commented Feb 11, 2026

  • SignTool crashes with "Unknown file format" / "Image is too small" when processing RPM, DEB, tar.gz, or PKG files containing symbolic links. For RPMs, the CPIO symlink entry's DataStream contains the link target path as text (e.g., mscorlib.dll), which gets passed to IsSignedPE() and fails. For tar/DEB, symlinks have null DataStream and are silently skipped, but should be explicitly filtered. For PKGs, Directory.EnumerateFiles returns symlinks as regular files.
  • Skip symbolic links (and directories) when reading container entries for signing, and preserve them during repacking so the output container retains its original symlink structure pointing to the real signed files.
  • Add symlink entries to test resource files (test.tgz, test.rpm, test.deb) and validate after signing+repacking that symlinks are preserved and resolve to the signed target files.
  • pkg tests were not added at this point in time because of Add MacOS legs to CI #16519 and that I don't have access to a mac to run any tests locally.

Validated in the VMR with https://dev.azure.com/dnceng/internal/_build/results?buildId=2902616&view=results

akoeplinger
akoeplinger previously approved these changes Feb 12, 2026
mmitche
mmitche previously approved these changes Feb 13, 2026
@MichaelSimons MichaelSimons enabled auto-merge (squash) February 13, 2026 17:01
@MichaelSimons MichaelSimons merged commit 96ff818 into dotnet:main Feb 13, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants