Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Arti Zirk <arti.zirk@gmail.com>
To: wireguard@lists.zx2c4.com
Subject: [PATCH] Fix wg-tool regex parsing for non en_US locale
Date: Sun,  5 Feb 2017 17:22:33 +0100	[thread overview]
Message-ID: <20170205162233.10810-1-arti.zirk@gmail.com> (raw)

On systems that have the default locale set to anything other than en_US
or C will be unable to use wg-quick because regex rules use to make sure
that the input interface name is a valid will fail. Forcing locale
inside the script to C seems to fix that.
---
 src/tools/wg-quick.bash | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash
index 5db3485..c4f0cfd 100755
--- a/src/tools/wg-quick.bash
+++ b/src/tools/wg-quick.bash
@@ -6,6 +6,9 @@
 set -e -o pipefail
 shopt -s extglob
 
+# regex will change behavior based on the current locale, so lets set it to somehting that should work on most systems
+export LANG=C
+
 SELF="$(readlink -f "${BASH_SOURCE[0]}")"
 export PATH="${SELF%/*}:$PATH"
 
-- 
2.11.1

             reply	other threads:[~2017-02-05 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-05 16:22 Arti Zirk [this message]
2017-02-05 22:00 ` Jason A. Donenfeld

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=20170205162233.10810-1-arti.zirk@gmail.com \
    --to=arti.zirk@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).