From 64a7e209802434c069a662edbd77bda1e85530c5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 25 Jul 2014 12:28:34 +0200 Subject: libmount: don't use /{proc,ext}/filesystems when more fs types specified # mkfs.ext4 /dev/sda1 # mount -t foo,bar /dev/sda1 /mnt successfully mount the device, this is unexpected as extN is no between wanted (by -t specified) filesystems. Summary about -t: * "mount -t foo" mount(2) with "foo" type * "mount -t foo,bar" try mount(2) with "foo" or "bar" * "mount -t foo,auto" try mount(2) with "foo" or ask libblkid for the type * "mount -t nofoo,bar" try types from /{etc,proc}/filesystems, but exclude "foo" and "bar" Note that more filesystems may be specified in fstab (as comma delimited list). The stuff from fstab is always interpreted as list and never as a pattern ("no" prefix makes no sense in fstab). Reported-by: Benno Schulenberg Signed-off-by: Karel Zak --- sys-utils/mount.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys-utils/mount.c') diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 74a1a84f2..f7084a963 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -572,7 +572,10 @@ try_readonly: break; case ENODEV: - warnx(_("unknown filesystem type '%s'"), mnt_context_get_fstype(cxt)); + if (mnt_context_get_fstype(cxt)) + warnx(_("unknown filesystem type '%s'"), mnt_context_get_fstype(cxt)); + else + warnx(_("unknown filesystem type")); break; case ENOTBLK: -- cgit v1.2.3-55-g7522