From: Harald Hoyer Date: Wed, 19 Aug 2015 14:18:23 +0000 (+0200) Subject: crypt/module-setup.sh: fixed parsing crypttab with no ending newline X-Git-Tag: RHEL-7.2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b70b81f1c4dc0cc13851feefe870788290cff0a7;p=thirdparty%2Fdracut.git crypt/module-setup.sh: fixed parsing crypttab with no ending newline --- diff --git a/dracut.sh b/dracut.sh index 90ac1fe9b..65824ec73 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1045,7 +1045,7 @@ if [[ $hostonly ]]; then [[ "$_d" -ef "$dev" ]] || continue if [[ -f /etc/crypttab ]]; then - while read _mapper _a _p _o; do + while read _mapper _a _p _o || [ -n "$_mapper" ]; do [[ $_mapper = \#* ]] && continue [[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue [[ "$_o" ]] || _o="$_p" diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh index bd37d9a53..f8422fa96 100755 --- a/modules.d/90crypt/module-setup.sh +++ b/modules.d/90crypt/module-setup.sh @@ -63,7 +63,7 @@ install() { if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then # filter /etc/crypttab for the devices we need - while read _mapper _dev _rest; do + while read _mapper _dev _rest || [ -n "$_mapper" ]; do [[ $_mapper = \#* ]] && continue [[ $_dev ]] || continue