164
176
{ "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */
165
177
{ "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
180
{ "relatime", 0, 0, MS_RELATIME }, /* Update access times relative to
182
{ "norelatime", 0, 1, MS_RELATIME }, /* Update access time without regard
167
185
{ NULL, 0, 0, 0 }
170
188
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_encryption,
171
*opt_speed, *opt_comment;
189
*opt_speed, *opt_comment, *opt_uhelper;
191
static int mounted (const char *spec0, const char *node0);
192
static int check_special_mountprog(const char *spec, const char *node,
193
const char *type, int flags, char *extra_opts, int *status);
173
195
static struct string_opt_map {
247
my_free(const void *s) {
280
/* reallocates its first arg */
282
append_opt(char *s, const char *opt, const char *val)
288
return xstrdup(opt); /* opt */
290
return xstrconcat3(NULL, opt, val); /* opt=val */
293
return xstrconcat3(s, ",", opt); /* s,opt */
295
return xstrconcat4(s, ",", opt, val); /* s,opt=val */
299
append_numopt(char *s, const char *opt, long num)
303
snprintf(buf, sizeof(buf), "%ld", num);
304
return append_opt(s, opt, buf);
307
#ifdef HAVE_LIBSELINUX
308
/* strip quotes from a "string"
309
* Warning: This function modify the "str" argument.
312
strip_quotes(char *str)
319
end = strrchr(str, '"');
320
if (end == NULL || end == str)
321
die (EX_USAGE, _("mount: improperly quoted option string '%s'"), str);
327
/* translates SELinux context from human to raw format and
328
* appends it to the mount extra options.
330
* returns -1 on error and 0 on success
333
append_context(const char *optname, char *optdata, char **extra_opts)
335
security_context_t raw = NULL;
338
if (!is_selinux_enabled())
339
/* ignore the option if we running without selinux */
342
if (optdata==NULL || *optdata=='\0' || optname==NULL)
345
/* TODO: use strip_quotes() for all mount options? */
346
data = *optdata =='"' ? strip_quotes(optdata) : optdata;
348
if (selinux_trans_to_raw_context(
349
(security_context_t) data, &raw)==-1 ||
354
printf(_("mount: translated %s '%s' to '%s'\n"),
355
optname, data, (char *) raw);
357
*extra_opts = append_opt(*extra_opts, optname, NULL);
358
*extra_opts = xstrconcat4(*extra_opts, "\"", (char *) raw, "\"");
253
366
* Look for OPT in opt_map table and return mask value.
282
len -= strlen(extra_opts);
284
if (*extra_opts && --len > 0)
285
strcat(extra_opts, ",");
287
395
/* convert nonnumeric ids to numeric */
288
396
if (!strncmp(opt, "uid=", 4) && !isdigit(opt[4])) {
289
397
struct passwd *pw = getpwnam(opt+4);
293
sprintf(uidbuf, "uid=%d", pw->pw_uid);
294
if ((len -= strlen(uidbuf)) > 0)
295
strcat(extra_opts, uidbuf);
400
*extra_opts = append_numopt(*extra_opts,
299
405
if (!strncmp(opt, "gid=", 4) && !isdigit(opt[4])) {
300
406
struct group *gr = getgrnam(opt+4);
304
sprintf(gidbuf, "gid=%d", gr->gr_gid);
305
if ((len -= strlen(gidbuf)) > 0)
306
strcat(extra_opts, gidbuf);
409
*extra_opts = append_numopt(*extra_opts,
311
if ((len -= strlen(opt)) > 0)
312
strcat(extra_opts, opt);
415
#ifdef HAVE_LIBSELINUX
416
if (strncmp(opt, "context=", 8) == 0 && *(opt+8)) {
417
if (append_context("context=", opt+8, extra_opts) == 0)
420
if (strncmp(opt, "fscontext=", 10) == 0 && *(opt+10)) {
421
if (append_context("fscontext=", opt+10, extra_opts) == 0)
424
if (strncmp(opt, "defcontext=", 11) == 0 && *(opt+11)) {
425
if (append_context("defcontext=", opt+11, extra_opts) == 0)
429
*extra_opts = append_opt(*extra_opts, opt, NULL);
315
432
/* Take -o options list and compute 4th and 5th args to mount(2). flags
316
433
gets the standard options (indicated by bits) and extra_opts all the rest */
324
441
if (options != NULL) {
325
442
char *opts = xstrdup(options);
327
int len = strlen(opts) + 20;
329
*extra_opts = xmalloc(len);
332
for (opt = strtok(opts, ","); opt; opt = strtok(NULL, ","))
333
if (!parse_string_opt(opt))
334
parse_opt(opt, flags, *extra_opts, len);
446
for (p=opts, opt=NULL; p && *p; p++) {
448
opt = p; /* begin of the option item */
450
open_quote ^= 1; /* reverse the status */
452
continue; /* still in quoted block */
454
*p = '\0'; /* terminate the option item */
455
/* end of option item or last item */
456
if (*p == '\0' || *(p+1) == '\0') {
457
if (!parse_string_opt(opt))
458
parse_opt(opt, flags, extra_opts);
350
479
const struct string_opt_map *m;
353
new_opts = xstrdup((flags & MS_RDONLY) ? "ro" : "rw");
482
new_opts = append_opt(NULL, (flags & MS_RDONLY) ? "ro" : "rw", NULL);
354
483
for (om = opt_map; om->opt != NULL; om++) {
357
486
if (om->inv || !om->mask || (flags & om->mask) != om->mask)
359
new_opts = xstrconcat3(new_opts, ",", om->opt);
488
new_opts = append_opt(new_opts, om->opt, NULL);
360
489
flags &= ~om->mask;
362
491
for (m = &string_opt_map[0]; m->tag; m++) {
363
492
if (!m->skip && *(m->valptr))
364
new_opts = xstrconcat4(new_opts, ",",
365
m->tag, *(m->valptr));
367
if (extra_opts && *extra_opts) {
368
new_opts = xstrconcat3(new_opts, ",", extra_opts);
371
new_opts = xstrconcat3(new_opts, ",user=", user);
493
new_opts = append_opt(new_opts, m->tag, *(m->valptr));
495
if (extra_opts && *extra_opts)
496
new_opts = append_opt(new_opts, extra_opts, NULL);
499
new_opts = append_opt(new_opts, "user=", user);
449
577
do_mount_syscall (struct mountargs *args) {
450
578
int flags = args->flags;
453
580
if ((flags & MS_MGC_MSK) == 0)
454
581
flags |= MS_MGC_VAL;
456
ret = mount (args->spec, args->node, args->type, flags, args->data);
584
printf("mount: mount(2) syscall: source: \"%s\", target: \"%s\", "
585
"filesystemtype: \"%s\", mountflags: %d, data: %s\n",
586
args->spec, args->node, args->type, flags, (char *) args->data);
588
return mount (args->spec, args->node, args->type, flags, args->data);
593
* Mount a single file system, possibly invoking an external handler to
594
* do so. Keep track of successes.
595
* returns: 0: OK, -1: error in errno
598
do_mount (struct mountargs *args, int *special, int *status) {
600
if (check_special_mountprog(args->spec, args->node, args->type,
601
args->flags, args->data, status)) {
605
ret = do_mount_syscall(args);
613
* check_special_mountprog()
614
* If there is a special mount program for this type, exec it.
615
* returns: 0: no exec was done, 1: exec was done, status has result
618
check_special_mountprog(const char *spec, const char *node, const char *type, int flags,
619
char *extra_opts, int *status) {
624
if (!external_allowed)
627
if (type && strlen(type) < 100) {
628
sprintf(mountprog, "/sbin/mount.%s", type);
629
if (stat(mountprog, &statbuf) == 0) {
634
char *oo, *mountargs[10];
637
if(setgid(getgid()) < 0)
638
die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
640
if(setuid(getuid()) < 0)
641
die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
643
oo = fix_opts_string (flags, extra_opts, NULL);
644
mountargs[i++] = mountprog; /* 1 */
645
mountargs[i++] = (char *) spec; /* 2 */
646
mountargs[i++] = (char *) node; /* 3 */
647
if (sloppy && strncmp(type, "nfs", 3) == 0)
648
mountargs[i++] = "-s"; /* 4 */
650
mountargs[i++] = "-f"; /* 5 */
652
mountargs[i++] = "-n"; /* 6 */
654
mountargs[i++] = "-v"; /* 7 */
656
mountargs[i++] = "-o"; /* 8 */
657
mountargs[i++] = oo; /* 9 */
659
mountargs[i] = NULL; /* 10 */
663
while(verbose > 2 && mountargs[i]) {
664
printf("mount: external mount: argv[%d] = \"%s\"\n",
671
execv(mountprog, mountargs);
672
exit(1); /* exec failed */
673
} else if (res != -1) {
676
*status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
680
error(_("mount: cannot fork: %s"), strerror(errsv));
689
guess_fstype_by_devname(const char *devname)
691
const char *type = fsprobe_get_fstype_by_devname(devname);
694
printf (_("mount: you didn't specify a filesystem type for %s\n"), devname);
697
printf (_(" I will try all types mentioned in %s or %s\n"),
698
ETC_FILESYSTEMS, PROC_FILESYSTEMS);
699
else if (!strcmp(type, "swap"))
700
printf (_(" and it looks like this is swapspace\n"));
702
printf (_(" I will try type %s\n"), type);
463
708
* guess_fstype_and_mount()
464
709
* Mount a single file system. Guess the type when unknown.
465
710
* returns: 0: OK, -1: error in errno, 1: other error
617
867
printf(_("mount: skipping the setup of a loop device\n"));
619
869
int loopro = (*flags & MS_RDONLY);
621
if (!*loopdev || !**loopdev)
622
*loopdev = find_unused_loop_device();
624
return EX_SYSERR; /* no more loop devices */
626
printf(_("mount: going to use the loop device %s\n"), *loopdev);
627
872
offset = opt_offset ? strtoull(opt_offset, NULL, 0) : 0;
628
if (set_loop(*loopdev, *loopfile, offset,
629
opt_encryption, pfd, &loopro)) {
875
if (!*loopdev || !**loopdev)
876
*loopdev = find_unused_loop_device();
878
return EX_SYSERR; /* no more loop devices */
631
printf(_("mount: failed setting up loop device\n"));
880
printf(_("mount: going to use the loop device %s\n"), *loopdev);
882
if ((res = set_loop(*loopdev, *loopfile, offset,
883
opt_encryption, pfd, &loopro))) {
885
/* loop dev has been grabbed by some other process,
886
try again, if not given explicitly */
889
printf(_("mount: stolen loop=%s ...trying again\n"), *loopdev);
894
error(_("mount: stolen loop=%s"), *loopdev);
899
printf(_("mount: failed setting up loop device\n"));
635
910
printf(_("mount: setup loop device successfully\n"));
636
911
*spec = *loopdev;
716
* check_special_mountprog()
717
* If there is a special mount program for this type, exec it.
718
* returns: 0: no exec was done, 1: exec was done, status has result
722
check_special_mountprog(const char *spec, const char *node, const char *type,
723
int flags, char *extra_opts, int *status) {
728
if (!external_allowed)
731
if (type && strlen(type) < 100) {
732
sprintf(mountprog, "/sbin/mount.%s", type);
733
if (stat(mountprog, &statbuf) == 0) {
736
const char *oo, *mountargs[10];
741
oo = fix_opts_string (flags, extra_opts, NULL);
742
mountargs[i++] = mountprog;
743
mountargs[i++] = spec;
744
mountargs[i++] = node;
746
mountargs[i++] = "-n";
748
mountargs[i++] = "-v";
750
mountargs[i++] = "-o";
754
execv(mountprog, (char **) mountargs);
755
exit(1); /* exec failed */
756
} else if (res != -1) {
759
*status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
763
error(_("mount: cannot fork: %s"), strerror(errsv));
771
993
* try_mount_one()
772
994
* Try to mount one file system. When "bg" is 1, this is a retry
773
995
* in the background. One additional exit code EX_BG is used here.
791
1013
const char *loopdev = 0, *loopfile = 0;
792
1014
struct stat statbuf;
793
int nfs_mount_version = 0; /* any version */
795
1016
/* copies for freeing on exit */
796
1017
const char *opts1, *spec1, *node1, *types1, *extra_opts1;
1020
printf("mount: spec: \"%s\"\n", spec0);
1021
printf("mount: node: \"%s\"\n", node0);
1022
printf("mount: types: \"%s\"\n", types0);
1023
printf("mount: opts: \"%s\"\n", opts0);
798
1026
spec = spec1 = xstrdup(spec0);
799
1027
node = node1 = xstrdup(node0);
800
1028
types = types1 = xstrdup(types0);
839
* Also nfs requires a separate program, but it is built in.
841
if (!fake && types && streq (types, "nfs")) {
844
mnt_err = nfsmount (spec, node, &flags, &extra_opts, &mount_opts,
845
&nfs_mount_version, bg);
851
die (EX_SOFTWARE, _("mount: this version was compiled "
852
"without support for the type `nfs'"));
856
1077
block_signals (SIG_BLOCK);
859
1080
mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS,
1081
mount_opts, &special, &status);
1084
block_signals (SIG_UNBLOCK);
862
1090
if (fake || mnt5_res == 0) {
863
1091
/* Mount succeeded, report this (if verbose) and write mtab entry. */
865
opt_loopdev = loopdev;
867
update_mtab_entry(loop ? loopfile : spec,
1093
if (!(mounttype & MS_PROPAGATION)) {
1094
update_mtab_entry(loop ? loopfile : spec,
869
1096
types ? types : "unknown",
870
1097
fix_opts_string (flags & ~MS_NOMTAB, extra_opts, user),
875
1103
block_signals (SIG_UNBLOCK);
1027
if (u && is_in_procfs(lowtype) == 1)
1246
if (u && fsprobe_known_fstype_in_procfs(lowtype) == 1)
1028
1247
error (_("mount: probably you meant %s"), lowtype);
1029
else if (!strncmp(lowtype, "iso", 3) && is_in_procfs("iso9660") == 1)
1248
else if (!strncmp(lowtype, "iso", 3) &&
1249
fsprobe_known_fstype_in_procfs("iso9660") == 1)
1030
1250
error (_("mount: maybe you meant 'iso9660'?"));
1031
else if (!strncmp(lowtype, "fat", 3) && is_in_procfs("vfat") == 1)
1251
else if (!strncmp(lowtype, "fat", 3) &&
1252
fsprobe_known_fstype_in_procfs("vfat") == 1)
1032
1253
error (_("mount: maybe you meant 'vfat'?"));
1154
1376
mount_one (const char *spec, const char *node, const char *types,
1155
const char *opts, char *cmdlineopts, int freq, int pass) {
1377
const char *fstabopts, char *cmdlineopts, int freq, int pass) {
1156
1378
int status, status2;
1157
1379
const char *nspec;
1159
1382
/* Substitute values in opts, if required */
1160
opts = usersubst(opts);
1383
opts = usersubst(fstabopts);
1162
1385
/* Merge the fstab and command line options. */
1165
else if (cmdlineopts != NULL)
1166
opts = xstrconcat3(opts, ",", cmdlineopts);
1168
/* Handle possible LABEL= and UUID= forms of spec */
1169
nspec = mount_get_devname_for_mounting(spec);
1386
opts = append_opt(opts, cmdlineopts, NULL);
1173
1388
if (types == NULL && !mounttype && !is_existing_file(spec)) {
1174
1389
if (strchr (spec, ':') != NULL) {
1178
1393
"I'll assume nfs because of "
1179
1394
"the colon\n"));
1180
1395
} else if(!strncmp(spec, "//", 2)) {
1183
1398
printf(_("mount: no type was given - "
1184
"I'll assume smbfs because of "
1399
"I'll assume cifs because of "
1185
1400
"the // prefix\n"));
1404
/* Handle possible LABEL= and UUID= forms of spec */
1405
if (types == NULL || (strncmp(types, "nfs", 3) &&
1406
strncmp(types, "cifs", 4) &&
1407
strncmp(types, "smbfs", 5))) {
1408
nspec = fsprobe_get_devname_for_mounting(spec);
1190
1414
* Try to mount the file system. When the exit status is EX_BG,
1191
1415
* we will retry in the background. Otherwise, we're done.
1414
1637
{ "move", 0, 0, 133 },
1415
1638
{ "guess-fstype", 1, 0, 134 },
1416
1639
{ "rbind", 0, 0, 135 },
1640
{ "make-shared", 0, 0, 136 },
1641
{ "make-slave", 0, 0, 137 },
1642
{ "make-private", 0, 0, 138 },
1643
{ "make-unbindable", 0, 0, 139 },
1644
{ "make-rshared", 0, 0, 140 },
1645
{ "make-rslave", 0, 0, 141 },
1646
{ "make-rprivate", 0, 0, 142 },
1647
{ "make-runbindable", 0, 0, 143 },
1417
1648
{ "internal-only", 0, 0, 'i' },
1418
1649
{ NULL, 0, 0, 0 }
1440
1671
" mount --bind olddir newdir\n"
1441
1672
"or move a subtree:\n"
1442
1673
" mount --move olddir newdir\n"
1674
"One can change the type of mount containing the directory dir:\n"
1675
" mount --make-shared dir\n"
1676
" mount --make-slave dir\n"
1677
" mount --make-private dir\n"
1678
" mount --make-unbindable dir\n"
1679
"One can change the type of all the mounts in a mount subtree\n"
1680
"containing the directory dir:\n"
1681
" mount --make-rshared dir\n"
1682
" mount --make-rslave dir\n"
1683
" mount --make-rprivate dir\n"
1684
" mount --make-runbindable dir\n"
1443
1685
"A device can be given by name, say /dev/hda1 or /dev/cdrom,\n"
1444
1686
"or by label, using -L label or by uuid, using -U uuid .\n"
1445
1687
"Other options: [-nfFrsvw] [-o options] [-p passwdfd].\n"
1698
/* returns mount entry from fstab */
1699
static struct mntentchn *
1700
getfs(const char *spec, const char *uuid, const char *label)
1702
struct mntentchn *mc = NULL;
1703
const char *devname = NULL;
1705
if (!spec && !uuid && !label)
1709
* A) 99% of all cases, the spec on cmdline matches
1710
* with spec in fstab
1713
mc = getfs_by_uuid(uuid);
1715
mc = getfs_by_label(label);
1717
mc = getfs_by_spec(spec);
1720
mc = getfs_by_dir(spec);
1726
* B) UUID or LABEL on cmdline, but devname in fstab
1729
devname = fsprobe_get_devname_by_uuid(uuid);
1731
devname = fsprobe_get_devname_by_label(label);
1733
devname = fsprobe_get_devname(spec);
1736
mc = getfs_by_devname(devname);
1741
if (!mc && devname) {
1742
const char *id = NULL;
1744
if (!label && (!spec || strncmp(spec, "LABEL=", 6))) {
1745
id = fsprobe_get_label_by_devname(devname);
1747
mc = getfs_by_label(id);
1749
if (!mc && !uuid && (!spec || strncmp(spec, "UUID=", 5))) {
1750
id = fsprobe_get_uuid_by_devname(devname);
1752
mc = getfs_by_uuid(id);
1757
/* use real device name to avoid repetitional
1758
* conversion from LABEL/UUID to devname
1760
my_free(mc->m.mnt_fsname);
1761
mc->m.mnt_fsname = xstrdup(devname);
1766
* D) remount -- try /etc/mtab
1767
* Earlier mtab was tried first, but this would sometimes try the
1768
* wrong mount in case mtab had the root device entry wrong.
1770
if (!mc && (devname || spec))
1771
mc = getmntfile (devname ? devname : spec);
1456
1778
char *progname;
1459
1781
main(int argc, char *argv[]) {
1460
1782
int c, result = 0, specseen;
1461
1783
char *options = NULL, *test_opts = NULL, *node;
1463
char *volumelabel = NULL;
1784
const char *spec = NULL;
1464
1786
char *uuid = NULL;
1465
1787
char *types = NULL;
1513
1835
list_with_volumelabel = 1;
1516
volumelabel = optarg;
1518
1840
case 'n': /* do not write /etc/mtab */
1521
1843
case 'o': /* specify mount options */
1523
options = xstrconcat3(options, ",", optarg);
1525
options = xstrdup(optarg);
1844
options = append_opt(options, optarg, NULL);
1527
1846
case 'O': /* with -t: mount only if (not) opt */
1529
test_opts = xstrconcat3(test_opts, ",", optarg);
1531
test_opts = xstrdup(optarg);
1847
test_opts = append_opt(test_opts, optarg, NULL);
1533
1849
case 'p': /* fd on which to read passwd */
1534
1850
set_pfd(optarg);
1583
1899
use only for testing purposes -
1584
1900
the guessing is not reliable at all */
1587
fstype = do_guess_fstype(optarg);
1903
fstype = fsprobe_get_fstype_by_devname(optarg);
1588
1904
printf("%s\n", fstype ? fstype : "unknown");
1589
1905
exit(fstype ? 0 : EX_FAIL);
1592
1908
mounttype = (MS_BIND | MS_REC);
1912
mounttype = MS_SHARED;
1916
mounttype = MS_SLAVE;
1920
mounttype = MS_PRIVATE;
1924
mounttype = MS_UNBINDABLE;
1928
mounttype = (MS_SHARED | MS_REC);
1932
mounttype = (MS_SLAVE | MS_REC);
1936
mounttype = (MS_PRIVATE | MS_REC);
1940
mounttype = (MS_UNBINDABLE | MS_REC);
1596
1945
usage (stderr, EX_USAGE);
1950
printf("mount: fstab path: \"%s\"\n", _PATH_FSTAB);
1951
printf("mount: lock path: \"%s\"\n", MOUNTED_LOCK);
1952
printf("mount: temp path: \"%s\"\n", MOUNTED_TEMP);
1600
1955
argc -= optind;
1601
1956
argv += optind;
1603
specseen = (uuid || volumelabel) ? 1 : 0; /* yes, .. i know */
1958
specseen = (uuid || label) ? 1 : 0; /* yes, .. i know */
1605
1960
if (argc+specseen == 0 && !mount_all) {
1606
1961
if (options || mounttype)
1622
1977
create_mtab ();
1627
spec = mount_get_devname_by_uuid(uuid);
1629
spec = mount_get_devname_by_label(volumelabel);
1632
die (EX_USAGE, _("mount: no such partition found"));
1634
printf(_("mount: mounting %s\n"), spec);
1636
spec = NULL; /* just for gcc */
1638
1980
switch (argc+specseen) {
1641
1983
result = do_mount_all (types, options, test_opts);
1642
if (result == 0 && verbose)
1984
if (result == 0 && verbose && !fake)
1643
1985
error(_("nothing was mounted"));
1647
/* mount [-nfrvw] [-o options] special | node */
1989
/* mount [-nfrvw] [-o options] special | node
1990
* mount -L label (or -U uuid)
1991
* (/etc/fstab is necessary)
1648
1993
if (types != NULL)
1649
1994
usage (stderr, EX_USAGE);
1651
/* We know the device. Where shall we mount it? */
1652
mc = (uuid ? getfsuuidspec (uuid)
1653
: getfsvolspec (volumelabel));
1655
mc = getfsspec (spec);
1658
_("mount: cannot find %s in %s"),
1660
mc->m.mnt_fsname = spec;
1662
/* Try to find the other pathname in fstab. */
1663
spec = canonicalize (*argv);
1664
if ((mc = getfsspec (spec)) == NULL &&
1665
(mc = getfsfile (spec)) == NULL &&
1666
/* Try noncanonical name in fstab
1667
perhaps /dev/cdrom or /dos is a symlink */
1668
(mc = getfsspec (*argv)) == NULL &&
1669
(mc = getfsfile (*argv)) == NULL &&
1670
/* Try mtab - maybe this was a remount */
1671
(mc = getmntfile (spec)) == NULL)
1673
_("mount: can't find %s in %s or %s"),
1674
spec, _PATH_FSTAB, MOUNTED);
1675
/* Earlier mtab was tried first, but this would
1676
sometimes try the wrong mount in case mtab had
1677
the root device entry wrong. */
1997
mc = getfs(NULL, uuid, label);
1999
mc = getfs(*argv, NULL, NULL);
2003
die (EX_USAGE, _("mount: no such partition found"));
2006
_("mount: can't find %s in %s or %s"),
2007
*argv, _PATH_FSTAB, MOUNTED);
1682
2010
result = mount_one (xstrdup (mc->m.mnt_fsname),
1689
/* mount [-nfrvw] [-t vfstype] [-o options] special node */
2017
/* mount special node (/etc/fstab is not necessary) */
1690
2018
if (specseen) {
1691
/* we have spec already */
2019
/* mount -L label node (or -U uuid) */
2020
spec = uuid ? fsprobe_get_devname_by_uuid(uuid) :
2021
fsprobe_get_devname_by_label(label);
1692
2022
node = argv[0];
2024
/* mount special node */
1694
2025
spec = argv[0];
1695
2026
node = argv[1];
2029
die (EX_USAGE, _("mount: no such partition found"));
1697
2031
result = mount_one (spec, node, types, NULL, options, 0, 0);
1701
2035
usage (stderr, EX_USAGE);