aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-08-12 00:28:28 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-12 00:28:28 -0700
commitffcc09358e98aa82f658df21cdaa4aef46b27e83 (patch)
tree66a39f467490b5abf49f02f0b1cabea90f121029 /src
parentwg-quick: android: remove compat code (diff)
downloadwireguard-tools-ffcc09358e98aa82f658df21cdaa4aef46b27e83.tar.xz
wireguard-tools-ffcc09358e98aa82f658df21cdaa4aef46b27e83.zip
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 <durumcrustulum@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wg-quick/darwin.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash
index ece16f2..30f3541 100755
--- a/src/wg-quick/darwin.bash
+++ b/src/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=""