luks: retry the interactive password prompt on mismatch

This commit is contained in:
Titouan Heyrendt committed 2026-09-17 12:28:01 +02:00
1 parent ff8702b4de
commit 4084b6c7bd
2 files changed
+86 -1

No files matched your search

+7 -1
View File
@@ -218,14 +218,20 @@ in
export password
# shellcheck disable=SC2154
if [ "$password" != "$password_check" ]; then
exit 1
return 1
fi
set -x
else
export password=disko
fi
}
attempts=0
until askPassword; do
attempts=$((attempts + 1))
if [ "$attempts" -ge 3 ]; then
echo "Too many mismatched password attempts for ${config.device}, aborting." >&2
exit 1
fi
echo "Passwords did not match, please try again."
done
''}