Skip to content

Fix LaunchAgent/LaunchDaemon loading on macOS 27#285

Open
martinvandiemen wants to merge 1 commit into
mainfrom
fix-creating-lauchagents-launchdaemons
Open

Fix LaunchAgent/LaunchDaemon loading on macOS 27#285
martinvandiemen wants to merge 1 commit into
mainfrom
fix-creating-lauchagents-launchdaemons

Conversation

@martinvandiemen

Copy link
Copy Markdown

Create launchd plists with PlistBuddy instead of defaults write. defaults hands the write to cfprefsd, which adds a com.apple.quarantine extended attribute to every file it creates. Starting with macOS 27 beta 3, launchd refuses to load quarantined property list files.

  • Remove existing plists before recreation so upgrades clear stale quarantine attributes from previous installs
  • Add SpawnConstraint (macOS 14+) so launchd only spawns binaries signed with the Root3 Team ID, preventing orphaned plists from launching a substituted binary
  • Strip com.apple.quarantine as an extra safeguard

Create launchd plists with PlistBuddy instead of `defaults write`.
defaults hands the write to cfprefsd, which adds a com.apple.quarantine
extended attribute to every file it creates. Starting with macOS 27
beta 3, launchd refuses to load quarantined property list files.

- Remove existing plists before recreation so upgrades clear stale
  quarantine attributes from previous installs
- Add SpawnConstraint (macOS 14+) so launchd only spawns binaries
  signed with the Root3 Team ID, preventing orphaned plists from
  launching a substituted binary
- Strip com.apple.quarantine as an extra safeguard
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.

1 participant