summaryrefslogtreecommitdiffstats
path: root/libmount/src/context.c
diff options
context:
space:
mode:
authorGleb Fotengauer-Malinovskiy2012-09-27 18:48:34 +0200
committerKarel Zak2012-11-16 10:31:49 +0100
commitbbf9ce79eca50e2c9464a4f81571dc2616a5a59b (patch)
tree945920e644c908200ae21aa1ff1b9a1c53cd0e7f /libmount/src/context.c
parentumount: (recursive) don't call umount(2) for already unmounted targets (diff)
downloadkernel-qcow2-util-linux-bbf9ce79eca50e2c9464a4f81571dc2616a5a59b.tar.gz
kernel-qcow2-util-linux-bbf9ce79eca50e2c9464a4f81571dc2616a5a59b.tar.xz
kernel-qcow2-util-linux-bbf9ce79eca50e2c9464a4f81571dc2616a5a59b.zip
libmount: fix support of comma-separated fs types lists
# grep cdrom /etc/fstab /dev/sr0 /media/cdrom udf,iso9660 ro,noauto,user,utf8 0 0 # mount /media/cdrom mount: unknown filesystem type 'udf,iso9660' # mount -t udf,iso9660 /dev/sr0 /media/cdrom mount: /dev/sr0 is write-protected, mounting read-only [kzak@redhat.com: - add some comments - don't try to found external helpers for the types] Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r--libmount/src/context.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c
index ad97dc8e7..721c497ef 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -714,15 +714,14 @@ const char *mnt_context_get_target(struct libmnt_context *cxt)
* @cxt: mount context
* @fstype: filesystem type
*
- * Note that the @fstype has to be the real FS type. For comma-separated list of
- * filesystems or for "nofs" notation use mnt_context_set_fstype_pattern().
+ * Note that the @fstype has to be the real FS type. For patterns with
+ * comma-separated list of filesystems or for "nofs" notation use
+ * mnt_context_set_fstype_pattern().
*
* Returns: 0 on success, negative number in case of error.
*/
int mnt_context_set_fstype(struct libmnt_context *cxt, const char *fstype)
{
- if (fstype && strchr(fstype, ','))
- return -EINVAL;
return mnt_fs_set_fstype(mnt_context_get_fs(cxt), fstype);
}
@@ -1482,6 +1481,9 @@ int mnt_context_prepare_helper(struct libmnt_context *cxt, const char *name,
if (!type)
type = mnt_fs_get_fstype(cxt->fs);
+ if (type && strchr(type, ','))
+ return 0; /* type is fstype pattern */
+
if (mnt_context_is_nohelpers(cxt)
|| !type
|| !strcmp(type, "none")