Skip to content

Commit

Permalink
Be sure that the discovered filesystem is not null.
Browse files Browse the repository at this point in the history
- 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.

Signed-off-by: Marco Amadori <marco.amadori@gmail.com>
  • Loading branch information
mammadori committed Aug 6, 2008
1 parent 2966454 commit 26efb1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/live-helpers
Expand Up @@ -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
Expand Down

0 comments on commit 26efb1a

Please sign in to comment.