From: Amadeusz Żołnowski Date: Mon, 7 Mar 2011 12:48:02 +0000 (+0100) Subject: crypt-lib.sh: moved IFS=: from before 'read' to before 'while' X-Git-Tag: 009~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b20ff981c4b31d650ac0b2e5227f4d6f6eb459e2;p=thirdparty%2Fdracut.git 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. --- 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