Commit cef5cd25 authored by Mimi Zohar's avatar Mimi Zohar
Browse files

selftest/kexec: fix "ignored null byte in input" warning



Instead of assigning the string to a variable, which might contain a
null character, redirect the output and grep for the string directly.

Reviewed-by: default avatarPetr Vorel <pvorel@suse.cz>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 92ad1955
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -97,10 +97,11 @@ check_for_imasig()
check_for_modsig()
{
	local module_sig_string="~Module signature appended~"
	local sig="$(tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE)"
	local ret=0

	if [ "$sig" == "$module_sig_string" ]; then
	tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE | \
		grep -q "$module_sig_string"
	if [ $? -eq 0 ]; then
		ret=1
		log_info "kexec kernel image modsig signed"
	else