From b20ff981c4b31d650ac0b2e5227f4d6f6eb459e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amadeusz=20=C5=BBo=C5=82nowski?= Date: Mon, 7 Mar 2011 13:48:02 +0100 Subject: [PATCH] crypt-lib.sh: moved IFS=: from before 'read' to before 'while' Some versions of dash don't behave as expected with code like this: while IFS=: read a b c; do blah done Thanks to Eric Mertens who identified the issue. --- modules.d/90crypt/crypt-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh index 9083acaad..09e793da6 100644 --- a/modules.d/90crypt/crypt-lib.sh +++ b/modules.d/90crypt/crypt-lib.sh @@ -108,7 +108,8 @@ getkey() { [ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!' [ -f "$keys_file" ] || return 1 - while IFS=':' read luks_dev key_dev key_path; do + local IFS=: + while read luks_dev key_dev key_path; do if match_dev "$luks_dev" "$for_dev"; then echo "${key_dev}:${key_path}" return 0 -- 2.47.3