brew.sh: Don't allow system tmp dirs as prefixes
This commit is contained in:
parent
343a5b45a9
commit
35138dd6dd
@ -294,6 +294,20 @@ EOS
|
|||||||
}
|
}
|
||||||
check-run-command-as-root
|
check-run-command-as-root
|
||||||
|
|
||||||
|
check-prefix-is-not-tmpdir() {
|
||||||
|
if [[ "${HOMEBREW_PREFIX}" = /tmp/* ||
|
||||||
|
"${HOMEBREW_PREFIX}" = /private/tmp/* ]]
|
||||||
|
then
|
||||||
|
odie <<EOS
|
||||||
|
Your HOMEBREW_PREFIX is in one of the system temporary directories, which Homebrew
|
||||||
|
uses to store downloads and builds. You can resolve this by installing Homebrew to
|
||||||
|
either the standard prefix (/usr/local/) or to a non-standard prefix that is not
|
||||||
|
a system temporary directory.
|
||||||
|
EOS
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
check-prefix-is-not-tmpdir
|
||||||
|
|
||||||
if [[ "$HOMEBREW_PREFIX" = "/usr/local" &&
|
if [[ "$HOMEBREW_PREFIX" = "/usr/local" &&
|
||||||
"$HOMEBREW_PREFIX" != "$HOMEBREW_REPOSITORY" &&
|
"$HOMEBREW_PREFIX" != "$HOMEBREW_REPOSITORY" &&
|
||||||
"$HOMEBREW_CELLAR" = "$HOMEBREW_REPOSITORY/Cellar" ]]
|
"$HOMEBREW_CELLAR" = "$HOMEBREW_REPOSITORY/Cellar" ]]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user