tap-new: use run_as_real_uid: instead of Utils::UID.drop_euid#21839
Draft
carlocab wants to merge 1 commit intono-drop_euidfrom
Draft
tap-new: use run_as_real_uid: instead of Utils::UID.drop_euid#21839carlocab wants to merge 1 commit intono-drop_euidfrom
run_as_real_uid: instead of Utils::UID.drop_euid#21839carlocab wants to merge 1 commit intono-drop_euidfrom
Conversation
Now that `SystemCommand` supports `run_as_real_uid:`, replace the `Utils::UID.drop_euid` block in `tap-new` with `system_command!` calls using `run_as_real_uid: true`, and remove the now-unused `drop_euid` method. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates brew tap-new to avoid process-wide EUID switching by using SystemCommand’s run_as_real_uid: option for the git operations that should run as the real UID, and removes the now-unused Utils::UID.drop_euid helper.
Changes:
- Replace the
Utils::UID.drop_euidblock intap-newwithsystem_command!calls usingrun_as_real_uid: true. - Add
SystemCommand::Mixinusage totap-newto support the new command invocation. - Remove
Utils::UID.drop_euidfromutils/uid.rbnow that it has no callers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/utils/uid.rb | Removes the drop_euid helper now that callers have migrated away from process-wide EUID changes. |
| Library/Homebrew/dev-cmd/tap-new.rb | Runs git commands via system_command! with run_as_real_uid: true to avoid EUID race conditions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
brew lgtm(style, typechecking and tests) with your changes locally?Now that
SystemCommandsupportsrun_as_real_uid:, replace theUtils::UID.drop_euidblock intap-newwithsystem_command!callsusing
run_as_real_uid: true, and remove the now-unuseddrop_euidmethod.Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
As seen above, I used Claude to generate this PR. I reviewed the diff and ran
brew lgtmmanually.This is a follow-up to #21838. We should remove
Utils::UID.drop_euidbecause it is prone to race conditions.