wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Jorge AC <jorgeanton@gmail.com>
To: wireguard@lists.zx2c4.com
Subject: [PATCH 1012/1012] Support for unicode interface names: only '%', ':' and '/' must be avoided
Date: Sat, 25 Aug 2018 03:41:51 +0200	[thread overview]
Message-ID: <CAFafqTtD_Qk9pSZvurmg6tsWFyYLOarqJmA5bizpygxuOmPqbQ@mail.gmail.com> (raw)

---
 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

             reply	other threads:[~2018-08-25  1:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-25  1:41 Jorge AC [this message]
2018-08-25  5:26 ` [PATCH 1012/1012] Support for unicode interface names: only '%', ':' and '/' must be avoided Jason A. Donenfeld
2018-08-25 15:50   ` Jorge AC
2018-08-26 11:18     ` Jordan Glover
2018-08-26 16:57       ` Jorge AC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFafqTtD_Qk9pSZvurmg6tsWFyYLOarqJmA5bizpygxuOmPqbQ@mail.gmail.com \
    --to=jorgeanton@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).