From bbf9ce79eca50e2c9464a4f81571dc2616a5a59b Mon Sep 17 00:00:00 2001 From: Gleb Fotengauer-Malinovskiy Date: Thu, 27 Sep 2012 20:48:34 +0400 Subject: 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 Signed-off-by: Karel Zak --- libmount/src/context.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libmount/src/context.c') 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") -- cgit v1.2.3-55-g7522