/* Merge the fstab and command line options. */
opts = append_opt(opts, cmdlineopts, NULL);
- /* Handle possible LABEL= and UUID= forms of spec */
- nspec = fsprobe_get_devname_for_mounting(spec);
- if (nspec)
- spec = nspec;
-
if (types == NULL && !mounttype && !is_existing_file(spec)) {
if (strchr (spec, ':') != NULL) {
types = "nfs";
}
}
+ /* Handle possible LABEL= and UUID= forms of spec */
+ if (types == NULL || (strncmp(types, "nfs", 3) &&
+ strncmp(types, "cifs", 4) &&
+ strncmp(types, "smbfs", 5))) {
+ nspec = fsprobe_get_devname_for_mounting(spec);
+ if (nspec)
+ spec = nspec;
+ }
+
/*
* Try to mount the file system. When the exit status is EX_BG,
* we will retry in the background. Otherwise, we're done.
static int
mounted (const char *spec0, const char *node0) {
struct mntentchn *mc, *mc0;
- char *spec, *node;
+ const char *spec, *node;
int ret = 0;
/* Handle possible UUID= and LABEL= in spec */
- spec0 = fsprobe_get_devname(spec0);
- if (!spec0)
+ spec = fsprobe_get_devname(spec0);
+ if (!spec)
return ret;
- spec = canonicalize(spec0);
node = canonicalize(node0);
mc0 = mtab_head();