diff options
author | Karel Zak | 2014-07-25 12:28:34 +0200 |
---|---|---|
committer | Karel Zak | 2014-07-25 12:28:34 +0200 |
commit | 64a7e209802434c069a662edbd77bda1e85530c5 (patch) | |
tree | 9b89dd78efc02d7d3fc09de0ff258097da08722b /sys-utils/mount.c | |
parent | build-sys: fix switch_root/pivot_root cut-n-paste error in configure.ac (diff) | |
download | kernel-qcow2-util-linux-64a7e209802434c069a662edbd77bda1e85530c5.tar.gz kernel-qcow2-util-linux-64a7e209802434c069a662edbd77bda1e85530c5.tar.xz kernel-qcow2-util-linux-64a7e209802434c069a662edbd77bda1e85530c5.zip |
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 <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r-- | sys-utils/mount.c | 5 |
1 files changed, 4 insertions, 1 deletions
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: |