Be sure that the discovered filesystem is not null.
authorMarco Amadori <marco.amadori@gmail.com>
Wed, 6 Aug 2008 22:07:57 +0000 (00:07 +0200)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:48:00 +0000 (17:48 +0100)
- 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

index e1f69dd..619cbb4 100644 (file)
@@ -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