]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
crypt/module-setup.sh: fixed parsing crypttab with no ending newline
authorHarald Hoyer <harald@redhat.com>
Wed, 19 Aug 2015 14:18:23 +0000 (16:18 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 19 Aug 2015 14:19:31 +0000 (16:19 +0200)
dracut.sh
modules.d/90crypt/module-setup.sh

index 90ac1fe9b40eb8a62015b3684cce5d1407f7b07b..65824ec736014e67d3a5bc0f3413682c1cbd4856 100755 (executable)
--- 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"
index bd37d9a534df17269982a18bc0eda9cc13c88474..f8422fa960feffff43d226c40c44235597ddf7d8 100755 (executable)
@@ -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