wg-quick: freebsd: export TMPDIR when restoring and don't make empty
Otherwise mktemp doesn't see it, and if it's empty we wind up in /. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
fc719b7d7e
commit
7c20ac5ce2
1 changed files with 2 additions and 1 deletions
|
@ -42,8 +42,9 @@ unset ORIGINAL_TMPDIR
|
|||
make_temp() {
|
||||
local old_umask
|
||||
|
||||
[[ -v ORIGINAL_TMPDIR ]] && TMPDIR="$ORIGINAL_TMPDIR"
|
||||
[[ -v ORIGINAL_TMPDIR ]] && export TMPDIR="$ORIGINAL_TMPDIR"
|
||||
ORIGINAL_TMPDIR="$TMPDIR"
|
||||
[[ -z $TMPDIR ]] && unset TMPDIR
|
||||
|
||||
old_umask="$(umask)"
|
||||
umask 077
|
||||
|
|
Loading…
Reference in a new issue