fix: deploy-static - validate the release id with case, grep -x let a newline through

This commit is contained in:
cierzniak committed 2026-11-05 19:51:55 +01:00
1 parent 1619f254fa
commit f9f7e21e30
1 file changed
+5 -1
+5 -1
View File
@@ -16,7 +16,11 @@ cmd="${SSH_ORIGINAL_COMMAND:-}"
fail() { echo "deploy-static: $*" >&2; exit 1; }
valid_id() { printf '%s' "$1" | grep -qxE '[A-Za-z0-9][A-Za-z0-9._-]{0,63}'; }
# case zamiast grep: grep -x sprawdza linie osobno, więc id z nową linią (a\n../../x) by przeszło
valid_id() {
case "$1" in '' | [!A-Za-z0-9]* | *[!A-Za-z0-9._-]*) return 1 ;; esac
[ "${#1}" -le 64 ]
}
case "$cmd" in
"rsync --server "*)