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

brew: remove sudo call #5917

Merged
merged 1 commit into from
Mar 24, 2019
Merged
Changes from all 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
6 changes: 1 addition & 5 deletions Library/Homebrew/brew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,9 @@ class MissingEnvironmentVariables < RuntimeError; end

odie "Unknown command: #{cmd}" if !possible_tap || possible_tap.installed?

brew_uid = HOMEBREW_BREW_FILE.stat.uid
tap_commands = []
tap_commands += %W[/usr/bin/sudo -u ##{brew_uid}] if Process.uid.zero? && !brew_uid.zero?
# Unset HOMEBREW_HELP to avoid confusing the tap
ENV.delete("HOMEBREW_HELP") if help_flag
tap_commands += %W[#{HOMEBREW_BREW_FILE} tap #{possible_tap}]
safe_system(*tap_commands)
safe_system HOMEBREW_BREW_FILE, "tap", possible_tap.name
ENV["HOMEBREW_HELP"] = "1" if help_flag
exec HOMEBREW_BREW_FILE, cmd, *ARGV
end
Expand Down