kdump-lib-initramfs: harden is_mounted
If the device/mountpoint for findmnt is omitted findmnt will list all mounted filesystems. In that case it will always return "true". So explicitly check if an argument was passed to prevent false-positives. Signed-off-by: Philipp Rudo <prudo@redhat.com> Reviewed-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
12d9eff9dc
commit
ca306cd403
@ -30,7 +30,7 @@ kdump_get_conf_val()
|
|||||||
|
|
||||||
is_mounted()
|
is_mounted()
|
||||||
{
|
{
|
||||||
findmnt -k -n "$1" > /dev/null 2>&1
|
[ -n "$1" ] && findmnt -k -n "$1" > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: info type
|
# $1: info type
|
||||||
|
Loading…
Reference in New Issue
Block a user