mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-24 23:04:17 +08:00
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: Petr Vorel <pvorel@suse.cz> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
92ad19559e
commit
cef5cd25a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user