aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 19:19:48 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 19:19:48 +0200
commitfe9bc71e40a134ba37c7ff0cafda9f22b1fc3c63 (patch)
tree3cdf08a1eaac2873093661932e0d4deaf7f3011d /src
parentwg-quick: add intentionally undocumented userspace implementation knob (diff)
downloadwireguard-tools-fe9bc71e40a134ba37c7ff0cafda9f22b1fc3c63.tar.xz
wireguard-tools-fe9bc71e40a134ba37c7ff0cafda9f22b1fc3c63.zip
wg-quick: use invoking shell in auto rooting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wg-quick/darwin.bash3
-rwxr-xr-xsrc/wg-quick/linux.bash2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash
index 0eef3d9..581954c 100755
--- a/src/wg-quick/darwin.bash
+++ b/src/wg-quick/darwin.bash
@@ -9,6 +9,7 @@ shopt -s extglob
export LC_ALL=C
SELF="${BASH_SOURCE[0]}"
+[[ $SELF == */* ]] || SELF="./$SELF"
SELF="$(cd "${SELF%/*}" && pwd -P)/${SELF##*/}"
export PATH="${SELF%/*}:$PATH"
@@ -82,7 +83,7 @@ read_bool() {
}
auto_su() {
- [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " "$SELF" "${ARGS[@]}"
+ [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " -- "$BASH" -- "$SELF" "${ARGS[@]}"
}
get_real_interface() {
diff --git a/src/wg-quick/linux.bash b/src/wg-quick/linux.bash
index 9139e7f..3f1976b 100755
--- a/src/wg-quick/linux.bash
+++ b/src/wg-quick/linux.bash
@@ -79,7 +79,7 @@ read_bool() {
}
auto_su() {
- [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " "$SELF" "${ARGS[@]}"
+ [[ $UID == 0 ]] || exec sudo -p "$PROGRAM must be run as root. Please enter the password for %u to continue: " -- "$BASH" -- "$SELF" "${ARGS[@]}"
}
add_if() {