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

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