From 31f40045de3ced9d6e30aaab4d18986534318090 Mon Sep 17 00:00:00 2001 From: Marco Amadori Date: Thu, 7 Aug 2008 00:07:57 +0200 Subject: [PATCH] Be sure that the discovered filesystem is not null. - While scanning for a filesystem on a disk, the klibc utility can return a null string if it not finds a filesystem (e.g. on a container partition), and grepping for a null string either reports true if escaped or hangs grep if not escaped. Both conditions must be avoided in order to report that the kernel supports the filesystem named as the string. --- scripts/live-helpers | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/live-helpers b/scripts/live-helpers index e1f69dd..619cbb4 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -33,6 +33,12 @@ is_supported_fs () { fstype="${1}" + # Validate input first + if [ -z "${fstype}" ] + then + return 1 + fi + # Try to look if it is already supported by the kernel if grep -q ${fstype} /proc/filesystems then -- 2.1.4