Blame SOURCES/0316-crypt-module-setup.sh-fixed-parsing-crypttab-with-no.patch

712866
From b70b81f1c4dc0cc13851feefe870788290cff0a7 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 19 Aug 2015 16:18:23 +0200
712866
Subject: [PATCH] crypt/module-setup.sh: fixed parsing crypttab with no ending
712866
 newline
712866
712866
---
712866
 dracut.sh                         | 2 +-
712866
 modules.d/90crypt/module-setup.sh | 2 +-
712866
 2 files changed, 2 insertions(+), 2 deletions(-)
712866
712866
diff --git a/dracut.sh b/dracut.sh
5c6c2a
index 90ac1fe9..65824ec7 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -1045,7 +1045,7 @@ if [[ $hostonly ]]; then
712866
                 [[ "$_d" -ef "$dev" ]] || continue
712866
 
712866
                 if [[ -f /etc/crypttab ]]; then
712866
-                    while read _mapper _a _p _o; do
712866
+                    while read _mapper _a _p _o || [ -n "$_mapper" ]; do
712866
                         [[ $_mapper = \#* ]] && continue
712866
                         [[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
712866
                         [[ "$_o" ]] || _o="$_p"
712866
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
5c6c2a
index bd37d9a5..f8422fa9 100755
712866
--- a/modules.d/90crypt/module-setup.sh
712866
+++ b/modules.d/90crypt/module-setup.sh
712866
@@ -63,7 +63,7 @@ install() {
712866
 
712866
     if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
712866
         # filter /etc/crypttab for the devices we need
712866
-        while read _mapper _dev _rest; do
712866
+        while read _mapper _dev _rest || [ -n "$_mapper" ]; do
712866
             [[ $_mapper = \#* ]] && continue
712866
             [[ $_dev ]] || continue
712866