add security for temp file

This commit is contained in:
Simon Vieille 2019-08-01 11:03:12 +02:00
vecāks 2a9538eaab
revīzija 182544a6fe
Parakstījis: deblan
GPG atslēgas ID: 03383D15A1D31745
1 mainīti faili ar 4 papildinājumiem un 2 dzēšanām

Parādīt failu

@ -99,8 +99,9 @@ export WEB_HTTPS_DEFAULT_CERT_PRIVKEY
export WEB_HTTPS_DEFAULT_CERT_CHAIN
TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)"
template summary > "$TMP_FILE"
touch "$TMP_FILE"
chmod 600 "$TMP_FILE"
template summary > "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE"
@ -168,7 +169,8 @@ done
export USER_PASSWORD
TMP_FILE="/tmp/vhost-add-$(tr -dc "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" < /dev/urandom | head -c 16)"
template result > "$TMP_FILE"
touch "$TMP_FILE"
chmod 600 "$TMP_FILE"
template result > "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE"