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

Disallow running brew cask as root. #1476

Merged
merged 1 commit into from
Nov 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ fi
check-run-command-as-root() {
[[ "$(id -u)" = 0 ]] || return

# Homebrew Cask may need `sudo` for system-wide installation.
[[ "$HOMEBREW_COMMAND" = "cask" ]] && return

# Homebrew Services may need `sudo` for system-wide daemons.
[[ "$HOMEBREW_COMMAND" = "services" ]] && return

Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/cask/lib/hbc/cli/doctor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def self.run
ohai "Contents of $PATH Environment Variable:", render_env_var("PATH")
ohai "Contents of $SHELL Environment Variable:", render_env_var("SHELL")
ohai "Contents of Locale Environment Variables:", render_with_none(locale_variables)
ohai "Running As Privileged User:", render_with_none_as_error(privileged_uid)
end

def self.alt_taps
Expand Down Expand Up @@ -107,12 +106,6 @@ def self.locale_variables
ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).collect { |v| %Q(#{v}="#{ENV[v]}") }.sort.join("\n")
end

def self.privileged_uid
Process.euid.zero? ? "Yes #{error_string "warning: not recommended"}" : "No"
rescue StandardError
notfound_string
end

def self.none_string
"<NONE>"
end
Expand Down