From 1f06ed858886a63b7b38e18515df667a9758f4f8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 12 Aug 2018 00:28:28 -0700 Subject: wg-quick: darwin: prefer system paths for tools The only things wg-quick(8) needs from Homebrew are bash(1) and wg(8). Other than that, it's explicitly coded against the native system utilities. Since wg-quick(8) and bash(1) are invoked in auto_su by their full absolute path (via $SELF and $BASH, respectively), we can simply set the $PATH to be prefixed by the default system binary paths. This way, if users install tools that conflict with system tools -- such as GNU coreutils -- we won't accidently call those. Reported-by: Deirdre Connolly --- src/tools/wg-quick/darwin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/wg-quick/darwin.bash b/src/tools/wg-quick/darwin.bash index ece16f2..30f3541 100755 --- a/src/tools/wg-quick/darwin.bash +++ b/src/tools/wg-quick/darwin.bash @@ -11,7 +11,7 @@ export LC_ALL=C SELF="${BASH_SOURCE[0]}" [[ $SELF == */* ]] || SELF="./$SELF" SELF="$(cd "${SELF%/*}" && pwd -P)/${SELF##*/}" -export PATH="${SELF%/*}:$PATH" +export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${SELF%/*}:$PATH" WG_CONFIG="" INTERFACE="" -- cgit v1.2.3-59-g8ed1b