-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apple-codesign: add a test showing that symlink overwrites are broken
Unsure if there is a bug report for this. But it is definitely a bug.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
apple-codesign/tests/cmd/sign-bundle-symlink-overwrite.trycmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Sign a bundle with symlinks and verify symlink overwrites work | ||
|
||
``` | ||
$ rcodesign debug-create-macho MyApp.app/Contents/MacOS/MyApp | ||
assuming default minimum version 11.0.0 | ||
writing Mach-O to MyApp.app/Contents/MacOS/MyApp | ||
|
||
$ rcodesign debug-create-info-plist --bundle-name MyApp MyApp.app/Contents/Info.plist | ||
writing MyApp.app/Contents/Info.plist | ||
|
||
$ mkdir -p MyApp.app/Contents/Resources | ||
$ touch MyApp.app/Contents/Resources/file-00.txt | ||
$ touch MyApp.app/Contents/Resources/file-01.txt | ||
$ ln -s file-00.txt MyApp.app/Contents/Resources/file.txt | ||
|
||
$ rcodesign sign MyApp.app MyApp.app.signed | ||
signing MyApp.app to MyApp.app.signed | ||
signing bundle at MyApp.app | ||
signing 0 nested bundles in the following order: | ||
signing bundle at MyApp.app into MyApp.app.signed | ||
collecting code resources files | ||
copying file MyApp.app/Contents/Info.plist -> MyApp.app.signed/Contents/Info.plist | ||
sealing regular file Resources/file-00.txt | ||
copying file MyApp.app/Contents/Resources/file-00.txt -> MyApp.app.signed/Contents/Resources/file-00.txt | ||
sealing regular file Resources/file-01.txt | ||
copying file MyApp.app/Contents/Resources/file-01.txt -> MyApp.app.signed/Contents/Resources/file-01.txt | ||
sealing symlink Resources/file.txt -> file-00.txt | ||
replicating symlink MyApp.app.signed/Contents/Resources/file.txt -> file-00.txt | ||
writing sealed resources to MyApp.app.signed/Contents/_CodeSignature/CodeResources | ||
signing main executable Contents/MacOS/MyApp | ||
setting main executable binary identifier to com.example.mybundle (derived from CFBundleIdentifier in Info.plist) | ||
inferring default signing settings from Mach-O binary | ||
signing Mach-O binary at index 0 | ||
binary targets macOS >= 11.0.0 with SDK 11.0.0 | ||
creating ad-hoc signature | ||
code directory version: 132096 | ||
total signature size: 421 bytes | ||
writing signed main executable to MyApp.app.signed/Contents/MacOS/MyApp | ||
|
||
$ ln -s file-01.txt MyApp.app/Contents/Resources/file.txt | ||
? 1 | ||
/Users/gps/src/apple-platform-rs/target/coreutils/bin/ln: Already exists | ||
|
||
$ rcodesign sign MyApp.app MyApp.app.signed | ||
? 1 | ||
signing MyApp.app to MyApp.app.signed | ||
signing bundle at MyApp.app | ||
signing 0 nested bundles in the following order: | ||
signing bundle at MyApp.app into MyApp.app.signed | ||
collecting code resources files | ||
copying file MyApp.app/Contents/Info.plist -> MyApp.app.signed/Contents/Info.plist | ||
sealing regular file Resources/file-00.txt | ||
copying file MyApp.app/Contents/Resources/file-00.txt -> MyApp.app.signed/Contents/Resources/file-00.txt | ||
sealing regular file Resources/file-01.txt | ||
copying file MyApp.app/Contents/Resources/file-01.txt -> MyApp.app.signed/Contents/Resources/file-01.txt | ||
sealing symlink Resources/file.txt -> file-00.txt | ||
replicating symlink MyApp.app.signed/Contents/Resources/file.txt -> file-00.txt | ||
Error: I/O error: File exists (os error 17) | ||
|
||
``` |