From 47177c0ec92a6e6b73d1247f384ba6cc94a6ccfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20M=C3=A9meint?= Date: Tue, 2 Apr 2024 17:43:40 +0200 Subject: [PATCH] nixos/luksroot: Exit if EOF detected --- nixos/modules/system/boot/luksroot.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index 65190e65d9b9..59876dabc5f9 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -502,7 +502,11 @@ let echo -n "Passphrase for $device: " IFS= read -rs passphrase + ret=$? echo + if [ $ret -ne 0 ]; then + die "End of file reached. Exiting shell." + fi rm /crypt-ramfs/device echo -n "$passphrase" > /crypt-ramfs/passphrase