Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo: Prioritize sudo_as_root over HOMEBREW_SUDO_THROUGH_SUDO_USER. #16368

Merged
merged 5 commits into from
Dec 21, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions Library/Homebrew/system_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ def sudo_prefix
*askpass_flags,
"-E", *env_args,
"--", "/usr/bin/sudo"]
elsif sudo_as_root?
user_flags += ["-u", "root"]
end
user_flags += sudo_as_root? ? ["-u", "root"] : []
Kentzo marked this conversation as resolved.
Show resolved Hide resolved
["/usr/bin/sudo", *user_flags, *askpass_flags, "-E", *env_args, "--"]
end

Expand Down