From 27b0ca4b473461119d92b4c3f4a18cda5bc1cba7 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 25 Aug 2016 18:32:32 +0100 Subject: brew.sh: complain when running Homebrew as root. As discussed: announce that we are deprecating running Homebrew as the root user as it's insecure and requires disabling the sandbox. Fixes #796. --- Library/Homebrew/brew.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 722a7750d..c7bc840e7 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -200,6 +200,21 @@ then fi check-run-command-as-root() { + [[ "$(id -u)" = 0 ]] || return + export HOMEBREW_NO_SANDBOX="1" + + [[ "$HOMEBREW_COMMAND" = "services" ]] && return + + onoe <