]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: ifnames have max len of 15
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 10 Jan 2018 01:37:03 +0000 (02:37 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 10 Jan 2018 01:51:01 +0000 (02:51 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
contrib/reresolve-dns/reresolve-dns.sh
src/wg-quick.8
src/wg-quick.bash

index 274aed8e7bdb72c6119f6b01003a32c4d7adb7dd..7f913ab65e2a26ce68c3a8aeb8e052ddd5d41215 100755 (executable)
@@ -9,8 +9,8 @@ shopt -s extglob
 export LC_ALL=C
 
 CONFIG_FILE="$1"
-[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,16}$ ]] && CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
-[[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,16})\.conf$ ]]
+[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
+[[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]]
 INTERFACE="${BASH_REMATCH[1]}"
 
 process_peer() {
index 2039094600b7c2d8b07ad59d01f21a64dbc41773..ceffb0d992c406fca260a703f43e4775613368ec 100644 (file)
@@ -97,7 +97,7 @@ interface upon shutdown.
 .P
 Recommended \fIINTERFACE\fP names include `wg0' or `wgvpn0' or even `wgmgmtlan0'.
 However, the number at the end is in fact optional, and really
-any free-form string [a-zA-Z0-9_=+.-]{1,16} will work. So even interface names corresponding
+any free-form string [a-zA-Z0-9_=+.-]{1,15} will work. So even interface names corresponding
 to geographic locations would suffice, such as `cincinnati', `nyc', or `paris', if that's
 somehow desirable.
 
index aceeebc0f138f30036228bfdac630b4b60718de6..a028b982cd15860a13bf71ce4d646d7b854b5f75 100755 (executable)
@@ -29,9 +29,9 @@ ARGS=( "$@" )
 parse_options() {
        local interface_section=0 line key value
        CONFIG_FILE="$1"
-       [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,16}$ ]] && CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
+       [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
        [[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
-       [[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,16})\.conf$ ]] || die "The config file must be a valid interface name, followed by .conf"
+       [[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,15})\.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[1]}"