2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1980, 1989, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 static const char copyright[] =
34 "@(#) Copyright (c) 1980, 1989, 1993, 1994\n\
35 The Regents of the University of California. All rights reserved.\n";
37 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95";
41 #include <sys/cdefs.h>
42 __FBSDID("$FreeBSD$");
44 #include <sys/param.h>
45 #define _WANT_MNTOPTNAMES
46 #include <sys/mount.h>
67 #include "pathnames.h"
70 xo_close_container("mount"); \
76 #define MOUNT_META_OPTION_FSTAB "fstab"
77 #define MOUNT_META_OPTION_CURRENT "current"
79 static int debug, fstab_style, verbose;
87 char *catopt(char *, const char *);
88 struct statfs *getmntpt(const char *);
89 int hasopt(const char *, const char *);
90 int ismounted(struct fstab *, struct statfs *, int);
91 int isremountable(const char *);
92 void mangle(char *, struct cpa *);
93 char *update_options(char *, char *, int);
94 int mountfs(const char *, const char *, const char *,
95 int, const char *, const char *);
96 void remopt(char *, const char *);
97 void prmount(struct statfs *);
98 void putfsent(struct statfs *);
100 char *flags2opts(int);
102 /* Map from mount options to printable formats. */
103 static struct mntoptnames optnames[] = {
108 * List of VFS types that can be remounted without becoming mounted on top
110 * XXX Is this list correct?
113 remountable_fs_names[] = {
114 "ufs", "ffs", "ext2fs",
118 static const char userquotaeq[] = "userquota=";
119 static const char groupquotaeq[] = "groupquota=";
121 static char *mountprog = NULL;
124 use_mountprog(const char *vfstype)
126 /* XXX: We need to get away from implementing external mount
127 * programs for every filesystem, and move towards having
128 * each filesystem properly implement the nmount() system call.
132 "cd9660", "mfs", "msdosfs", "nfs",
133 "nullfs", "smbfs", "udf", "unionfs",
137 if (mountprog != NULL)
140 for (i = 0; fs[i] != NULL; ++i) {
141 if (strcmp(vfstype, fs[i]) == 0)
149 exec_mountprog(const char *name, const char *execname, char *const argv[])
154 switch (pid = fork()) {
155 case -1: /* Error. */
159 /* Go find an executable. */
160 execvP(execname, _PATH_SYSPATH, argv);
161 if (errno == ENOENT) {
162 xo_warn("exec %s not found", execname);
163 if (execname[0] != '/') {
164 xo_warnx("in path: %s", _PATH_SYSPATH);
168 default: /* Parent. */
169 if (waitpid(pid, &status, 0) < 0) {
174 if (WIFEXITED(status)) {
175 if (WEXITSTATUS(status) != 0)
176 return (WEXITSTATUS(status));
177 } else if (WIFSIGNALED(status)) {
178 xo_warnx("%s: %s", name, sys_siglist[WTERMSIG(status)]);
188 specified_ro(const char *arg)
193 optbuf = strdup(arg);
195 xo_err(1, "strdup failed");
197 for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
198 if (strcmp(opt, "ro") == 0) {
211 pidfile_signal(_PATH_MOUNTDPID, SIGHUP, NULL);
215 main(int argc, char *argv[])
217 const char *mntfromname, **vfslist, *vfstype;
219 struct statfs *mntbuf;
220 int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro;
222 char *cp, *ep, *options;
224 all = init_flags = late = onlylate = 0;
230 argc = xo_parse_args(argc, argv);
233 xo_open_container("mount");
235 while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)
247 init_flags |= MNT_FORCE;
257 /* For compatibility with the Linux version of mount. */
261 options = catopt(options, optarg);
262 if (specified_ro(optarg))
271 options = catopt(options, "ro");
276 xo_errx(1, "only one -t option may be specified");
277 vfslist = makevfslist(optarg);
281 init_flags |= MNT_UPDATE;
287 options = catopt(options, "noro");
297 #define BADTYPE(type) \
298 (strcmp(type, FSTAB_RO) && \
299 strcmp(type, FSTAB_RW) && strcmp(type, FSTAB_RQ))
301 if ((init_flags & MNT_UPDATE) && (ro == 0))
302 options = catopt(options, "noro");
307 if ((mntsize = getmntinfo(&mntbuf,
308 verbose ? MNT_WAIT : MNT_NOWAIT)) == 0)
309 xo_err(1, "getmntinfo");
311 while ((fs = getfsent()) != NULL) {
312 if (BADTYPE(fs->fs_type))
314 if (checkvfsname(fs->fs_vfstype, vfslist))
316 if (hasopt(fs->fs_mntops, "noauto"))
318 if (!hasopt(fs->fs_mntops, "late") && onlylate)
320 if (hasopt(fs->fs_mntops, "late") && !late)
322 if (hasopt(fs->fs_mntops, "failok"))
326 if (!(init_flags & MNT_UPDATE) &&
327 !hasopt(fs->fs_mntops, "update") &&
328 ismounted(fs, mntbuf, mntsize))
330 options = update_options(options, fs->fs_mntops,
332 if (mountfs(fs->fs_vfstype, fs->fs_spec,
333 fs->fs_file, init_flags, options,
334 fs->fs_mntops) && !failok)
337 } else if (fstab_style) {
338 xo_open_list("fstab");
339 for (i = 0; i < mntsize; i++) {
340 if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
342 xo_open_instance("fstab");
343 putfsent(&mntbuf[i]);
344 xo_close_instance("fstab");
346 xo_close_list("fstab");
348 xo_open_list("mounted");
349 for (i = 0; i < mntsize; i++) {
350 if (checkvfsname(mntbuf[i].f_fstypename,
354 (mntbuf[i].f_flags & MNT_IGNORE) != 0)
356 xo_open_instance("mounted");
358 xo_close_instance("mounted");
360 xo_close_list("mounted");
367 rmslashes(*argv, *argv);
368 if (init_flags & MNT_UPDATE) {
371 if ((mntbuf = getmntpt(*argv)) == NULL)
372 xo_errx(1, "not currently mounted %s", *argv);
374 * Only get the mntflags from fstab if both mntpoint
375 * and mntspec are identical. Also handle the special
376 * case where just '/' is mounted and 'spec' is not
377 * identical with the one from fstab ('/dev' is missing
378 * in the spec-string at boot-time).
380 if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL) {
381 if (strcmp(fs->fs_spec,
382 mntbuf->f_mntfromname) == 0 &&
384 mntbuf->f_mntonname) == 0) {
386 mntfromname = mntbuf->f_mntfromname;
387 } else if (argv[0][0] == '/' &&
388 argv[0][1] == '\0' &&
389 strcmp(fs->fs_vfstype,
390 mntbuf->f_fstypename) == 0) {
393 mntfromname = fs->fs_spec;
397 options = update_options(options, fs->fs_mntops,
400 mntfromname = mntbuf->f_mntfromname;
401 options = update_options(options, NULL,
404 rval = mountfs(mntbuf->f_fstypename, mntfromname,
405 mntbuf->f_mntonname, init_flags, options, 0);
408 if ((fs = getfsfile(*argv)) == NULL &&
409 (fs = getfsspec(*argv)) == NULL)
410 xo_errx(1, "%s: unknown special file or file system",
412 if (BADTYPE(fs->fs_type))
413 xo_errx(1, "%s has unknown file system type",
415 rval = mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file,
416 init_flags, options, fs->fs_mntops);
420 * If -t flag has not been specified, the path cannot be
421 * found, spec contains either a ':' or a '@', then assume
422 * that an NFS file system is being specified ala Sun.
423 * Check if the hostname contains only allowed characters
424 * to reduce false positives. IPv6 addresses containing
425 * ':' will be correctly parsed only if the separator is '@'.
426 * The definition of a valid hostname is taken from RFC 1034.
428 if (vfslist == NULL && ((ep = strchr(argv[0], '@')) != NULL ||
429 (ep = strchr(argv[0], ':')) != NULL)) {
432 ep = cp + strlen(cp);
436 if (!isdigit(*cp) && !isalpha(*cp) &&
437 *cp != '.' && *cp != '-' && *cp != ':')
444 rval = mountfs(vfstype,
445 argv[0], argv[1], init_flags, options, NULL);
453 * If the mount was successfully, and done by root, tell mountd the
456 if (rval == 0 && getuid() == 0)
463 ismounted(struct fstab *fs, struct statfs *mntbuf, int mntsize)
465 char realfsfile[PATH_MAX];
468 if (fs->fs_file[0] == '/' && fs->fs_file[1] == '\0')
469 /* the root file system can always be remounted */
472 /* The user may have specified a symlink in fstab, resolve the path */
473 if (realpath(fs->fs_file, realfsfile) == NULL) {
474 /* Cannot resolve the path, use original one */
475 strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile));
479 * Consider the filesystem to be mounted if:
480 * It has the same mountpoint as a mounted filesystem, and
481 * It has the same type as that same mounted filesystem, and
482 * It has the same device name as that same mounted filesystem, OR
483 * It is a nonremountable filesystem
485 for (i = mntsize - 1; i >= 0; --i)
486 if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 &&
487 strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 &&
488 (!isremountable(fs->fs_vfstype) ||
489 (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)))
495 isremountable(const char *vfsname)
499 for (cp = remountable_fs_names; *cp; cp++)
500 if (strcmp(*cp, vfsname) == 0)
506 hasopt(const char *mntopts, const char *option)
511 if (option[0] == 'n' && option[1] == 'o') {
516 optbuf = strdup(mntopts);
518 for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
519 if (opt[0] == 'n' && opt[1] == 'o') {
520 if (!strcasecmp(opt + 2, option))
522 } else if (!strcasecmp(opt, option))
530 append_arg(struct cpa *sa, char *arg)
532 if (sa->c + 1 == sa->sz) {
533 sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
534 sa->a = realloc(sa->a, sizeof(*sa->a) * sa->sz);
536 xo_errx(1, "realloc failed");
538 sa->a[++sa->c] = arg;
542 mountfs(const char *vfstype, const char *spec, const char *name, int flags,
543 const char *options, const char *mntopts)
547 char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX];
548 static struct cpa mnt_argv;
550 /* resolve the mountpoint with realpath(3) */
551 if (checkpath(name, mntpath) != 0) {
552 xo_warn("%s", mntpath);
559 optbuf = catopt(strdup(mntopts), options);
561 if (strcmp(name, "/") == 0)
563 if (flags & MNT_FORCE)
564 optbuf = catopt(optbuf, "force");
565 if (flags & MNT_RDONLY)
566 optbuf = catopt(optbuf, "ro");
569 * The mount_mfs (newfs) command uses -o to select the
570 * optimization mode. We don't pass the default "-o rw"
573 if (flags & MNT_UPDATE)
574 optbuf = catopt(optbuf, "update");
576 /* Compatibility glue. */
577 if (strcmp(vfstype, "msdos") == 0)
580 /* Construct the name of the appropriate mount command */
581 (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype);
584 append_arg(&mnt_argv, execname);
585 mangle(optbuf, &mnt_argv);
586 if (mountprog != NULL)
587 strlcpy(execname, mountprog, sizeof(execname));
589 append_arg(&mnt_argv, strdup(spec));
590 append_arg(&mnt_argv, strdup(name));
591 append_arg(&mnt_argv, NULL);
594 if (use_mountprog(vfstype))
595 xo_emit("{Lwc:exec}{:execname/%s}", execname);
597 xo_emit("{:execname/mount}{P: }{l:opts/-t}{P: }{l:opts/%s}", vfstype);
598 for (i = 1; i < mnt_argv.c; i++)
599 xo_emit("{P: }{l:opts}", mnt_argv.a[i]);
607 if (use_mountprog(vfstype)) {
608 ret = exec_mountprog(name, execname, mnt_argv.a);
610 ret = mount_fs(vfstype, mnt_argv.c, mnt_argv.a);
618 if (statfs(name, &sf) < 0) {
619 xo_warn("statfs %s", name);
623 xo_open_list("fstab");
624 xo_open_instance("fstab");
626 xo_close_instance("fstab");
627 xo_close_list("fstab");
629 xo_open_list("mounted");
630 xo_open_instance("mounted");
632 xo_close_instance("mounted");
633 xo_close_list("mounted");
641 prmount(struct statfs *sfp)
645 struct mntoptnames *o;
649 xo_emit("{:special/%hs}{L: on }{:node/%hs}{L: (}{:fstype}", sfp->f_mntfromname,
650 sfp->f_mntonname, sfp->f_fstypename);
652 flags = sfp->f_flags & MNT_VISFLAGMASK;
653 for (o = optnames; flags != 0 && o->o_opt != 0; o++)
654 if (flags & o->o_opt) {
655 xo_emit("{D:, }{l:opts}", o->o_name);
659 * Inform when file system is mounted by an unprivileged user
660 * or privileged non-root user.
662 if ((flags & MNT_USER) != 0 || sfp->f_owner != 0) {
663 xo_emit("{D:, }{L:mounted by }");
664 if ((pw = getpwuid(sfp->f_owner)) != NULL)
665 xo_emit("{:mounter/%hs}", pw->pw_name);
667 xo_emit("{:mounter/%hs}", sfp->f_owner);
670 if (sfp->f_syncwrites != 0 || sfp->f_asyncwrites != 0) {
671 xo_open_container("writes");
672 xo_emit("{D:, }{Lwc:writes}{Lw:sync}{w:sync/%ju}{Lw:async}{:async/%ju}",
673 (uintmax_t)sfp->f_syncwrites,
674 (uintmax_t)sfp->f_asyncwrites);
675 xo_close_container("writes");
677 if (sfp->f_syncreads != 0 || sfp->f_asyncreads != 0) {
678 xo_open_container("reads");
679 xo_emit("{D:, }{Lwc:reads}{Lw:sync}{w:sync/%ju}{Lw:async}{:async/%ju}",
680 (uintmax_t)sfp->f_syncreads,
681 (uintmax_t)sfp->f_asyncreads);
682 xo_close_container("reads");
684 if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) {
685 fsidbuf = malloc(sizeof(sfp->f_fsid) * 2 + 1);
687 xo_errx(1, "malloc failed");
688 for (i = 0; i < sizeof(sfp->f_fsid); i++)
689 sprintf(&fsidbuf[i * 2], "%02x",
690 ((u_char *)&sfp->f_fsid)[i]);
691 fsidbuf[i * 2] = '\0';
692 xo_emit("{D:, }{Lw:fsid}{:fsid}", fsidbuf);
695 if (sfp->f_nvnodelistsize != 0) {
696 xo_open_container("vnodes");
697 xo_emit("{D:, }{Lwc:vnodes}{Lw:count}{w:count/%ju}",
698 (uintmax_t)sfp->f_nvnodelistsize);
699 xo_close_container("vnodes");
706 getmntpt(const char *name)
708 struct statfs *mntbuf;
711 mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
712 for (i = mntsize - 1; i >= 0; i--) {
713 if (strcmp(mntbuf[i].f_mntfromname, name) == 0 ||
714 strcmp(mntbuf[i].f_mntonname, name) == 0)
721 catopt(char *s0, const char *s1)
725 if (s1 == NULL || *s1 == '\0')
729 if (asprintf(&cp, "%s,%s", s0, s1) == -1)
730 xo_errx(1, "asprintf failed");
740 mangle(char *options, struct cpa *a)
744 for (s = options; (p = strsep(&s, ",")) != NULL;)
746 if (strcmp(p, "noauto") == 0) {
748 * Do not pass noauto option to nmount().
749 * or external mount program. noauto is
750 * only used to prevent mounting a filesystem
751 * when 'mount -a' is specified, and is
752 * not a real mount option.
755 } else if (strcmp(p, "late") == 0) {
757 * "late" is used to prevent certain file
758 * systems from being mounted before late
759 * in the boot cycle; for instance,
760 * loopback NFS mounts can't be mounted
761 * before mountd starts.
764 } else if (strcmp(p, "failok") == 0) {
766 * "failok" is used to prevent certain file
767 * systems from being causing the system to
768 * drop into single user mode in the boot
769 * cycle, and is not a real mount option.
772 } else if (strncmp(p, "mountprog", 9) == 0) {
774 * "mountprog" is used to force the use of
775 * userland mount programs.
777 val = strchr(p, '=');
781 mountprog = strdup(val);
784 if (mountprog == NULL) {
785 xo_errx(1, "Need value for -o mountprog");
788 } else if (strcmp(p, "userquota") == 0) {
790 } else if (strncmp(p, userquotaeq,
791 sizeof(userquotaeq) - 1) == 0) {
793 } else if (strcmp(p, "groupquota") == 0) {
795 } else if (strncmp(p, groupquotaeq,
796 sizeof(groupquotaeq) - 1) == 0) {
798 } else if (*p == '-') {
803 append_arg(a, p + 1);
806 append_arg(a, strdup("-o"));
814 update_options(char *opts, char *fstab, int curflags)
818 char *expopt, *newopt, *tmpopt;
823 /* remove meta options from list */
824 remopt(fstab, MOUNT_META_OPTION_FSTAB);
825 remopt(fstab, MOUNT_META_OPTION_CURRENT);
826 cur = flags2opts(curflags);
829 * Expand all meta-options passed to us first.
832 for (p = opts; (o = strsep(&p, ",")) != NULL;) {
833 if (strcmp(MOUNT_META_OPTION_FSTAB, o) == 0)
834 expopt = catopt(expopt, fstab);
835 else if (strcmp(MOUNT_META_OPTION_CURRENT, o) == 0)
836 expopt = catopt(expopt, cur);
838 expopt = catopt(expopt, o);
844 * Remove previous contradictory arguments. Given option "foo" we
845 * remove all the "nofoo" options. Given "nofoo" we remove "nonofoo"
846 * and "foo" - so we can deal with possible options like "notice".
849 for (p = expopt; (o = strsep(&p, ",")) != NULL;) {
850 if ((tmpopt = malloc( strlen(o) + 2 + 1 )) == NULL)
851 xo_errx(1, "malloc failed");
853 strcpy(tmpopt, "no");
855 remopt(newopt, tmpopt);
858 if (strncmp("no", o, 2) == 0)
861 newopt = catopt(newopt, o);
869 remopt(char *string, const char *opt)
873 if (string == NULL || *string == '\0' || opt == NULL || *opt == '\0')
878 for (p = string; (o = strsep(&p, ",")) != NULL;) {
879 if (strcmp(opt, o) != 0) {
880 if (*r == ',' && *o != '\0')
882 while ((*r++ = *o++) != '\0')
894 xo_error("%s\n%s\n%s\n",
895 "usage: mount [-adflpruvw] [-F fstab] [-o options] [-t ufs | external_type]",
896 " mount [-dfpruvw] special | node",
897 " mount [-dfpruvw] [-o options] [-t ufs | external_type] special node");
902 putfsent(struct statfs *ent)
909 /* flags2opts() doesn't return the "rw" option. */
910 if ((ent->f_flags & MNT_RDONLY) != 0)
913 rw = catopt(NULL, "rw");
915 opts = flags2opts(ent->f_flags);
916 opts = catopt(rw, opts);
918 if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
919 strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
920 strlcpy(ent->f_mntfromname,
921 (strnstr(ent->f_mntfromname, ":", 8) +1),
922 sizeof(ent->f_mntfromname));
925 l = strlen(ent->f_mntfromname);
926 xo_emit("{:device}{P:/%s}{P:/%s}{P:/%s}",
930 l < 24 ? "\t" : " ");
931 l = strlen(ent->f_mntonname);
932 xo_emit("{:mntpoint}{P:/%s}{P:/%s}{P:/%s}",
936 l < 24 ? "\t" : " ");
937 xo_emit("{:fstype}{P:\t}", ent->f_fstypename);
939 xo_emit("{:opts}{P:/%s}", opts,
943 if ((fst = getfsspec(ent->f_mntfromname)))
944 xo_emit("{P:\t}{n:dump/%u}{P: }{n:pass/%u}\n",
945 fst->fs_freq, fst->fs_passno);
946 else if ((fst = getfsfile(ent->f_mntonname)))
947 xo_emit("{P:\t}{n:dump/%u}{P: }{n:pass/%u}\n",
948 fst->fs_freq, fst->fs_passno);
949 else if (strcmp(ent->f_fstypename, "ufs") == 0) {
950 if (strcmp(ent->f_mntonname, "/") == 0)
951 xo_emit("{P:\t}{n:dump/1}{P: }{n:pass/1}\n");
953 xo_emit("{P:\t}{n:dump/2}{P: }{n:pass/2}\n");
955 xo_emit("{P:\t}{n:dump/0}{P: }{n:pass/0}\n");
960 flags2opts(int flags)
966 if (flags & MNT_RDONLY) res = catopt(res, "ro");
967 if (flags & MNT_SYNCHRONOUS) res = catopt(res, "sync");
968 if (flags & MNT_NOEXEC) res = catopt(res, "noexec");
969 if (flags & MNT_NOSUID) res = catopt(res, "nosuid");
970 if (flags & MNT_UNION) res = catopt(res, "union");
971 if (flags & MNT_ASYNC) res = catopt(res, "async");
972 if (flags & MNT_NOATIME) res = catopt(res, "noatime");
973 if (flags & MNT_NOCLUSTERR) res = catopt(res, "noclusterr");
974 if (flags & MNT_NOCLUSTERW) res = catopt(res, "noclusterw");
975 if (flags & MNT_NOSYMFOLLOW) res = catopt(res, "nosymfollow");
976 if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir");
977 if (flags & MNT_MULTILABEL) res = catopt(res, "multilabel");
978 if (flags & MNT_ACLS) res = catopt(res, "acls");
979 if (flags & MNT_NFS4ACLS) res = catopt(res, "nfsv4acls");
980 if (flags & MNT_UNTRUSTED) res = catopt(res, "untrusted");
981 if (flags & MNT_NOCOVER) res = catopt(res, "nocover");
982 if (flags & MNT_EMPTYDIR) res = catopt(res, "emptydir");