From: Attila Áfra Date: Mon, 6 Aug 2007 12:48:37 +0000 (+0300) Subject: mount: fix incorrect behavior when more than one fs type is specified X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35eca7d577e01ad5145fb454a64006a2a9eb5dcb;p=util-linux mount: fix incorrect behavior when more than one fs type is specified "mount" may fail when more than one file system type is specified, and the requested access mode is read/write, but the device is read-only. The error message is: "mount: wrong fs type, bad option, bad superblock on...". It works only if the correct file system type is the last item in the comma separated list. This is because when it tries to mount the file system again in read-only mode, the "types" parameter passed to the "try_mount_one" function contains only the last item instead of the entire list. For example, you cannot mount a UDF CD/DVD with "-t udf,iso9660" if you don't also add the read-only option. This means that some Linux distributions with the default configuration may not be able to mount UDF disks automatically (e.g. Ubuntu Dapper - Gutsy Tribe 3). Signed-off-by: Attila Áfra Signed-off-by: Karel Zak --- diff --git a/mount/mount.c b/mount/mount.c index 6caea64a..d09fd5ef 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1279,10 +1279,9 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, bd, spec); break; } else { - if (loop) { - opts = opts0; - types = types0; - } + opts = opts0; + types = types0; + if (opts) { char *opts2 = append_opt(xstrdup(opts), "ro", NULL); my_free(opts1);