From 35138dd6ddb42376f9c4d541557454bcf672c659 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sat, 30 Jun 2018 09:34:21 -0400 Subject: [PATCH] brew.sh: Don't allow system tmp dirs as prefixes --- Library/Homebrew/brew.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index ba7572439b..b0a79d4cc3 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -294,6 +294,20 @@ EOS } check-run-command-as-root +check-prefix-is-not-tmpdir() { + if [[ "${HOMEBREW_PREFIX}" = /tmp/* || + "${HOMEBREW_PREFIX}" = /private/tmp/* ]] + then + odie <