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(a)redhat.com>
---
kdump-lib-initramfs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index e45d6de..06e1647 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -30,7 +30,7 @@ kdump_get_conf_val()
is_mounted()
{
- findmnt -k -n "$1" > /dev/null 2>&1
+ [ -n "$1" ] && findmnt -k -n "$1" > /dev/null
2>&1
}
# $1: info type
--
2.39.2