]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: strip NUL bytes in stream before push in string
authorHarald Hoyer <harald@redhat.com>
Thu, 30 Mar 2017 10:52:11 +0000 (12:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 30 Mar 2017 10:52:11 +0000 (12:52 +0200)
seems like bash-4.4 does not like NUL bytes in variables

dracut.sh

index 788e52bf83d0f9448dcb514c130356f6eab7cc0f..ccfa31dce7dc87fa8fa743c6bed49dccca709b50 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1622,7 +1622,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
     # strip kernel modules, but do not touch signed modules
     find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
         | while read -r -d $'\0' f || [ -n "$f" ]; do
-        SIG=$(tail -c 28 "$f")
+        SIG=$(tail -c 28 "$f" | tr -d '\000')
         [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
     done | xargs -r -0 strip -g