Skip to content
Snippets Groups Projects
Commit a0f99633 authored by Markus Reiter's avatar Markus Reiter
Browse files

Disallow running `brew cask` as `root`.

parent 842120cc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -31,7 +31,6 @@ module Hbc
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
......@@ -107,12 +106,6 @@ module Hbc
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment