wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* [PATCH 1012/1012] Support for unicode interface names: only '%', ':' and '/' must be avoided
@ 2018-08-25  1:41 Jorge AC
  2018-08-25  5:26 ` Jason A. Donenfeld
  0 siblings, 1 reply; 5+ messages in thread
From: Jorge AC @ 2018-08-25  1:41 UTC (permalink / raw)
  To: wireguard

---
 src/tools/wg-quick/linux.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index 48ce163..4317907 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -39,9 +39,9 @@ die() {
 parse_options() {
        local interface_section=0 line key value stripped
        CONFIG_FILE="$1"
-       [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] &&
CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
+       [[ -e $CONFIG_FILE ]] || CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
        [[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
-       [[ $CONFIG_FILE =~ (^|/)([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] ||
die "The config file must be a valid interface name, followed by
.conf"
+       [[ $CONFIG_FILE =~ (^|/)([^%:/]+)\.conf$ ]] || die "The config
file must be a valid interface name, followed by .conf"
        CONFIG_FILE="$(readlink -f "$CONFIG_FILE")"
        ((($(stat -c '0%#a' "$CONFIG_FILE") & $(stat -c '0%#a'
"${CONFIG_FILE%/*}") & 0007) == 0)) || echo "Warning: \`$CONFIG_FILE'
is world accessible" >&2
        INTERFACE="${BASH_REMATCH[2]}"
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-26 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-25  1:41 [PATCH 1012/1012] Support for unicode interface names: only '%', ':' and '/' must be avoided Jorge AC
2018-08-25  5:26 ` Jason A. Donenfeld
2018-08-25 15:50   ` Jorge AC
2018-08-26 11:18     ` Jordan Glover
2018-08-26 16:57       ` Jorge AC

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).