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

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