Skip to content

Clear the quarantine flag from the cask, for builds that need it - #8

Merged
dallasbpeters merged 1 commit into
mainfrom
rolemodel/cask-unquarantine
Aug 24, 2026
Merged

Clear the quarantine flag from the cask, for builds that need it#8
dallasbpeters merged 1 commit into
mainfrom
rolemodel/cask-unquarantine

Conversation

@dallasbpeters

Copy link
Copy Markdown
Member

install.sh stripped the quarantine attribute, so anyone following the documented path was fine — and anyone running brew install --cask rolemodel/tap/rolemodel-openscreen directly was not.

They get the dialog offering Move to Trash or Done, and Move to Trash genuinely deletes the app. That's how the first install on this machine lost its bundle entirely: /Applications empty, Caskroom holding a broken symlink.

Homebrew 6 removed --no-quarantine, so there's no flag to pass — it has to come off after the fact, and postflight is where a cask can do that.

Guarded, not unconditional

signature = Utils.popen_read("/usr/bin/codesign", "-d", "--verbose=2", app_path, err: :out)
next unless signature.include?("Signature=adhoc")

Once a release is signed with a Developer ID and notarized, macOS has no objection, and stripping quarantine would be discarding a real check for nothing. So this heals the unsigned builds and becomes a no-op the moment there's an identity — no follow-up change needed when the certificate lands.

It also opoos what it's doing and why. A cask that silently weakens Gatekeeper isn't something anyone should have to read the source to discover.

Related

Paired with RoleModel/openscreen#4, which stops ad-hoc builds carrying hardened runtime — the reason the app exited before drawing a window even once quarantine was cleared. Quarantine was necessary but not sufficient; both were needed.

lib/verify.mjs — 698 passed, 0 failed.

🤖 Generated with Claude Code

install.sh stripped the quarantine attribute, so anyone following the documented
path was fine and anyone running `brew install --cask` directly was not. They got
the dialog that offers Move to Trash or Done — and Move to Trash deletes the app,
which is how the first install on this machine lost its bundle.

Homebrew 6 removed --no-quarantine, so there is no flag to pass and it has to come
off afterwards. postflight is where the cask can do that.

Guarded on the signature rather than done unconditionally. Once a release is signed
with a Developer ID and notarized, macOS has no objection and stripping quarantine
would be discarding a real check for nothing — so this heals the unsigned builds
and turns itself into a no-op the moment there is an identity. It says out loud
what it is doing and why, because a cask silently weakening Gatekeeper is not
something anyone should have to read the source to discover.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dallasbpeters
dallasbpeters merged commit c2a813b into main Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant