]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: freebsd: avoid writing private keys to /tmp
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 14 Mar 2021 04:20:19 +0000 (21:20 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 14 Mar 2021 04:20:19 +0000 (21:20 -0700)
FreeBSD's bash doesn't handle <(...) safely, creating a temporary file
instead of using /proc/self/fd/N like on Linux. Work around this by
using a simple pipeline with /dev/stdin.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/freebsd.bash

index c6744d334a013213956c73377beadbeabba8f7f6..88aa2b406d2a1714cc374ddc20abe6d2ea414884 100755 (executable)
@@ -349,7 +349,7 @@ add_route() {
 }
 
 set_config() {
-       cmd wg setconf "$INTERFACE" <(echo "$WG_CONFIG")
+       echo "$WG_CONFIG" | cmd wg setconf "$INTERFACE" /dev/stdin
 }
 
 save_config() {