Repository navigation
fix(macos): strip quarantine before bootstrapping the broker service - #207
Conversation
ReenigneArcher
left a comment
There was a problem hiding this comment.
The quarantine cleanup passed local macOS validation. Please add the required regression coverage described in the inline comment; the included fixture was tested against both the current PR head and target branch.
Verified: bash -n, diff whitespace checks, native recursive/idempotent quarantine removal with unrelated attributes retained, and four sandboxed installer cases (quarantined/clean × optional payload present/absent). The target branch reproduces quarantine remaining at bootstrap; this head passes all four cases. No installed service was modified.
Validation limits: a signed quarantined DMG was not installed end to end. GitHub Actions workflows await maintainer approval. The GH-Pages Read the Docs status reports failure, but its logs were inaccessible, so I cannot attribute that failure to this patch. The head is mergeable into current master.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
Files copied from a browser-downloaded DMG inherit com.apple.quarantine. launchd refuses the quarantined LaunchDaemon plist, so the installer failed with "Bootstrap failed: 5: Input/output error". Remove the attribute from the installed apps, plist, and /usr/local files before bootstrapping the service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run install.command against a sandboxed fixture with quarantined and clean payloads, with and without the optional /usr/local files, and assert that nothing is quarantined when launchd bootstraps the service. Run the fixture in the macOS broker workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d1ef517 to
06216cd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #207 +/- ##
==========================================
- Coverage 73.64% 73.61% -0.04%
==========================================
Files 44 44
Lines 10705 10705
Branches 3651 3651
==========================================
- Hits 7884 7880 -4
- Misses 2161 2220 +59
+ Partials 660 605 -55
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
|
|



Description
Installing from a DMG downloaded with Safari or Chrome fails at the end of
Install libvirtualhid.command:The apps are copied to
/Applications, but the broker service never starts. Files on a mounted disk image inherit the image'scom.apple.quarantineattribute.installanddittokeep it, so/Library/LaunchDaemons/dev.lizardbyte.app.libvirtualhid.plistends up quarantined andlaunchctl bootstrap systemrejects it.This PR removes
com.apple.quarantine(withxattr -dr) from everything the installer copies, beforelaunchctl bootstrap:VirtualHIDBroker.appandVirtualHIDControl.app, right afterdittoand before the signature checks;/usr/localheaders, static library, license tool, CMake package, and license texts, when present.The installer already checks the bundled apps with
codesign --verify --deep --strictbefore and after copying them, and the DMG itself is notarized and stapled, so dropping the download marker does not skip any signature check.Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
Manual validation on macOS 27.0.1 (Apple Silicon), using the current release DMG (
libvirtualhid-macOS-universal.dmg, SHA-2566ebe73f6…236a871):Bootstrap failed: 5: Input/output error.xattr -lshowedcom.apple.quarantineon the installed plist and on both apps, andlaunchctl print system/dev.lizardbyte.app.libvirtualhidreported the service as missing.launchctl printreportedstate = running.bash -n scripts/macos/install.commandpasses.xattr -dr com.apple.quarantineremoves the attribute from a bundle and exits 0 on files and directories that do not have it, so the script stays compatible withset -efor DMGs opened without quarantine.Not run: I could not build a signed DMG containing this change (that needs the Developer ID identity and the virtual HID provisioning profile), so the patched installer has not been tested end to end from a quarantined DMG. No automated test was added because
install.commandrequiressudo,launchctl, and a mounted signed image, and the repository has no harness for it.Type of Change
Checklist
AI Usage
See our AI usage policy.
Claude Code helped diagnose the failed install, write the fix, and draft this description. I reproduced the failure and confirmed the workaround on my own Mac.
Generated with Claude Code (Claude Opus 5.5, low thinking level).
🤖 Generated with Claude Code