From adbc274797cdfd6b60b9ae2062fe9af0fdb40369 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Wed, 17 Jan 2024 20:41:53 +0000 Subject: [PATCH] homeassistant: More robust auth command --- roles/homeassistant/files/auth-command.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/homeassistant/files/auth-command.sh b/roles/homeassistant/files/auth-command.sh index 6b2c2dc..e64ee9c 100755 --- a/roles/homeassistant/files/auth-command.sh +++ b/roles/homeassistant/files/auth-command.sh @@ -2,6 +2,12 @@ set -eu +umask 077 + +if [ -z "${username:-}" ] || [ -z "${password:-}" ]; then + exit 2 +fi + if [ "$(echo "$username" | sed -r 's/^[a-z]+$/x/')" != "x" ]; then exit 2 fi