Skip to content

Fix #4 and enable codesign to interoperate with qemu-upstream's entitlement.sh script.#7

Merged
thefloweringash merged 2 commits intothefloweringash:entitlementsfrom
mstone:codesign-qemu
Sep 6, 2021
Merged

Fix #4 and enable codesign to interoperate with qemu-upstream's entitlement.sh script.#7
thefloweringash merged 2 commits intothefloweringash:entitlementsfrom
mstone:codesign-qemu

Conversation

@mstone
Copy link
Contributor

@mstone mstone commented Sep 4, 2021

This PR fixes #4 in the sense that it enables sigtool's C++ codesign implementation to interoperate with upstream qemu's entitlement.sh driver script, notably by adding support for the --force synonym for the -f option added in 9a2ec3f and by fixing a bug in the way that codesign was coordinating with codesign_allocate via 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 hvf acceleration support in nixpkgs aarch64-darwin packaging of qemu, e.g. partially re: NixOS/nixpkgs#135877 + NixOS/nixpkgs#121903 that are not, by themselves, needed for this PR.)

@mstone mstone mentioned this pull request Sep 4, 2021
12 tasks
@thefloweringash thefloweringash changed the base branch from main to entitlements September 6, 2021 20:20
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.
@thefloweringash thefloweringash merged commit 4ba4c37 into thefloweringash:entitlements Sep 6, 2021
@thefloweringash
Copy link
Owner

fixing a bug in the way that codesign was coordinating with codesign_allocate via temporary files

I'm happy to remove the temporary file cleverness if it's causing problems, but I'm curious what the bug was here.

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.

Merge entitlements branch?

2 participants