The mount blindly uses a SPEC from command line and tries to found the
SPEC in /etc/fstab. It's better to parse the SPEC and search by UUID,
LABEL or devname only.
Signed-off-by: Karel Zak <kzak@redhat.com>
/* Find the device SPEC in fstab. */
struct mntentchn *
getfs_by_spec (const char *spec) {
+ char *name, *value;
+ struct mntentchn *mc = NULL;
+
+ if (!spec)
+ return NULL;
+
+ if (parse_spec(spec, &name, &value) != 0)
+ return NULL; /* parse error */
+
+ if (name) {
+ if (!strcmp(name,"LABEL"))
+ mc = getfs_by_label (value);
+ else if (!strcmp(name,"UUID"))
+ mc = getfs_by_uuid (value);
+
+ free((void *) name);
+ return mc;
+ }
return getfs_by_devname(spec);
}