From: Harald Hoyer Date: Thu, 30 Mar 2017 10:52:11 +0000 (+0200) Subject: dracut.sh: strip NUL bytes in stream before push in string X-Git-Tag: 045~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0bfada399c2c3269de353be5af37224349839a0;p=thirdparty%2Fdracut.git dracut.sh: strip NUL bytes in stream before push in string seems like bash-4.4 does not like NUL bytes in variables --- diff --git a/dracut.sh b/dracut.sh index 788e52bf8..ccfa31dce 100755 --- 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