Repository navigation
Read protected install step symlinks with sudo - #24241
Merged
Merged
Conversation
Removing a cask's install step symlink failed with `EACCES` when the link was root-owned and unreadable, aborting uninstalls and upgrades. Steps that already allow `sudo` now read the target with `sudo readlink -n`, so the target check still runs before removal. A forked child reporting an error after its parent has failed and closed the pipe no longer prints a secondary `EPIPE` traceback. Signed-off-by: Patrick Linnane <patrick@linnane.io>
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.
Uninstalling or upgrading
docker-desktopfailed withErrno::EACCESwhen its install step symlink/usr/local/bin/kubectlwas root-owned with mode0700, because the uninstall step reads the link target before removing it. Install steps that already allowsudonow fall back tosudo readlink -nfor that check, and a forked child reporting an error after its parent has failed no longer prints anEPIPEtraceback ahead of the parent's error.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Codex (GPT-6 Astra) drafted the change and tests, checked the tests fail without the change and ran
brew lgtm --online; Claude Code (Opus 5.5) reviewed it, repeated that check independently and ranbrew lgtm --onlineon this commit.