From 20c713b2962b817998d5e57a3fac67e9d443884c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Apr 2019 18:16:16 +0900 Subject: wg-quick: make darwin and freebsd path search strict like linux --- src/tools/wg-quick/darwin.bash | 3 ++- src/tools/wg-quick/freebsd.bash | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/wg-quick/darwin.bash b/src/tools/wg-quick/darwin.bash index aa3edeb..a2b3789 100755 --- a/src/tools/wg-quick/darwin.bash +++ b/src/tools/wg-quick/darwin.bash @@ -47,7 +47,8 @@ parse_options() { CONFIG_FILE="$1" if [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]]; then for path in "${CONFIG_SEARCH_PATHS[@]}"; do - [[ -e $path/$CONFIG_FILE.conf ]] && { CONFIG_FILE="$path/$CONFIG_FILE.conf"; break; } + CONFIG_FILE="$path/$1.conf" + [[ -e $CONFIG_FILE ]] && break done fi [[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist" diff --git a/src/tools/wg-quick/freebsd.bash b/src/tools/wg-quick/freebsd.bash index 72e0bd0..a72353c 100755 --- a/src/tools/wg-quick/freebsd.bash +++ b/src/tools/wg-quick/freebsd.bash @@ -64,7 +64,8 @@ parse_options() { CONFIG_FILE="$1" if [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]]; then for path in "${CONFIG_SEARCH_PATHS[@]}"; do - [[ -e $path/$CONFIG_FILE.conf ]] && { CONFIG_FILE="$path/$CONFIG_FILE.conf"; break; } + CONFIG_FILE="$path/$1.conf" + [[ -e $CONFIG_FILE ]] && break done fi [[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist" -- cgit v1.2.3-59-g8ed1b