Fix #4 and enable codesign to interoperate with qemu-upstream's entitlement.sh script.#7
Merged
thefloweringash merged 2 commits intothefloweringash:entitlementsfrom Sep 6, 2021
Conversation
12 tasks
1. Rather than synthesizing a path to the tempfile created by `mkstemp(char* template)` via `/dev/fd/...`, we instead use the fact that `mkstemp()` mutates the buffer pointed to by `template` to directly obtain the name of the generated tempfile. 2. Ignore EINTR while waitpid()'ing for codesign_allocate to finish. (This, + changes to the buildsystem in another commit enable us to use lldb to debug failing executions.) 3. Finally, while we're at it, also stop `Commands::codesign()` from leaking `tempfileName` via a suitable std::unique_ptr.
1cb5ccf to
13072a4
Compare
Owner
I'm happy to remove the temporary file cleverness if it's causing problems, but I'm curious what the bug was here. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #4 in the sense that it enables
sigtool's C++codesignimplementation to interoperate with upstream qemu'sentitlement.shdriver script, notably by adding support for the--forcesynonym for the-foption added in 9a2ec3f and by fixing a bug in the way thatcodesignwas coordinating withcodesign_allocatevia temporary files.Tested via mstone/qemu-m1@076cae6 and mstone@9888891 (although these test refs contain commits with a couple of additional only tangentially-related changes for debugging convenience and for exploring what will be needed to enable
hvfacceleration support innixpkgsaarch64-darwinpackaging ofqemu, e.g. partially re: NixOS/nixpkgs#135877 + NixOS/nixpkgs#121903 that are not, by themselves, needed for this PR.)