From 4122a18340094151d7911e838237ec7627f0d0c5 Mon Sep 17 00:00:00 2001 From: williamvds Date: Sun, 22 Oct 2023 17:32:40 +0100 Subject: [PATCH] Fix read shellcheck warning SC2162 Use `-r` to avoid mangling backslashes, use `IFS=` to not discard leading and trailing whitespace. --- lib/types/luks.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/types/luks.nix b/lib/types/luks.nix index 978c54b..69df88d 100644 --- a/lib/types/luks.nix +++ b/lib/types/luks.nix @@ -108,9 +108,9 @@ in set +x askPassword() { echo "Enter password for ${config.device}: " - read -s password + IFS= read -r -s password echo "Enter password for ${config.device} again to be safe: " - read -s password_check + IFS= read -r -s password_check export password [ "$password" = "$password_check" ] } @@ -140,7 +140,7 @@ in ${lib.optionalString config.askPassword '' set +x echo "Enter password for ${config.device}" - read -s password + IFS= read -r -s password export password set -x ''}