cask/upgrade: preserve an unquarantined app's state across upgrades - #23556
Open
aholland wants to merge 1 commit into
Open
cask/upgrade: preserve an unquarantined app's state across upgrades#23556aholland wants to merge 1 commit into
aholland wants to merge 1 commit into
Conversation
An app with no quarantine attribute launches without a Gatekeeper prompt, so an upgrade should not reintroduce one. Treat that state like an approved one when deciding whether to carry approval forward, subject to the same signing identity check.
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.
Following on from #23545 and #23546. This one concerns self-updating casks. When such an app updates itself it replaces a bundle the user had already approved, since nothing unapproved gets far enough to run its own updater, and the version it puts in place carries no quarantine attribute at all. Such a version launches without any Gatekeeper prompt. Upgrading it through Homebrew brings the prompt back because the new version, having no approval to inherit, is quarantined afresh.
Walking through the process: The user approves the app once, and Homebrew carries that approval onto each new version it installs. Then at some point the app's own updater replaces the bundle, potentially multiple times in a series of auto-updates, leaving no quarantine attribute at all — self-updaters do not quarantine what they install. The app keeps launching without a prompt throughout. But the very first Homebrew upgrade subsequent to a self-update quarantines the new version afresh (it has nothing to inherit from) and the app the user has been opening freely for weeks through a series of upgrades may suddenly ask whether they are sure they want to open it.
Quite simply: approved stays approved (#23060, which preserves a cask's quarantine approval across upgrades), unapproved stays unapproved, and now unquarantined-due-to-self-update graduates to approved — approved rather than left untagged, so the download's audit trail is still recorded. Approval is granted only after the existing signing-identity check passes, so this approves nothing that #23060 would not have approved had the attribute survived.
To reproduce, with any installed cask:
Details
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Used Claude Code (Opus 5) to investigate and draft; I directed the investigation, and reviewed the diff and every line of this PR text.