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) {
214 pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid);
216 /* Mountd is not running. */
220 if (errno != EEXIST) {
221 /* Cannot open pidfile for some reason. */
226 * Refuse to send broadcast or group signals, this has
227 * happened due to the bugs in pidfile(3).
229 if (mountdpid <= 0) {
230 xo_warnx("mountd pid %d, refusing to send SIGHUP", mountdpid);
234 /* We have mountd(8) PID in mountdpid varible, let's signal it. */
235 if (kill(mountdpid, SIGHUP) == -1)
236 xo_err(1, "signal mountd");
240 main(int argc, char *argv[])
242 const char *mntfromname, **vfslist, *vfstype;
244 struct statfs *mntbuf;
245 int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro;
247 char *cp, *ep, *options;
249 all = init_flags = late = onlylate = 0;
255 argc = xo_parse_args(argc, argv);
258 xo_open_container("mount");
260 while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)
272 init_flags |= MNT_FORCE;
282 /* For compatibility with the Linux version of mount. */
286 options = catopt(options, optarg);
287 if (specified_ro(optarg))
296 options = catopt(options, "ro");
301 xo_errx(1, "only one -t option may be specified");
302 vfslist = makevfslist(optarg);
306 init_flags |= MNT_UPDATE;
312 options = catopt(options, "noro");
322 #define BADTYPE(type) \
323 (strcmp(type, FSTAB_RO) && \
324 strcmp(type, FSTAB_RW) && strcmp(type, FSTAB_RQ))
326 if ((init_flags & MNT_UPDATE) && (ro == 0))
327 options = catopt(options, "noro");
332 if ((mntsize = getmntinfo(&mntbuf,
333 verbose ? MNT_WAIT : MNT_NOWAIT)) == 0)
334 xo_err(1, "getmntinfo");
336 while ((fs = getfsent()) != NULL) {
337 if (BADTYPE(fs->fs_type))
339 if (checkvfsname(fs->fs_vfstype, vfslist))
341 if (hasopt(fs->fs_mntops, "noauto"))
343 if (!hasopt(fs->fs_mntops, "late") && onlylate)
345 if (hasopt(fs->fs_mntops, "late") && !late)
347 if (hasopt(fs->fs_mntops, "failok"))
351 if (!(init_flags & MNT_UPDATE) &&
352 !hasopt(fs->fs_mntops, "update") &&
353 ismounted(fs, mntbuf, mntsize))
355 options = update_options(options, fs->fs_mntops,
357 if (mountfs(fs->fs_vfstype, fs->fs_spec,
358 fs->fs_file, init_flags, options,
359 fs->fs_mntops) && !failok)
362 } else if (fstab_style) {
363 xo_open_list("fstab");
364 for (i = 0; i < mntsize; i++) {
365 if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
367 xo_open_instance("fstab");
368 putfsent(&mntbuf[i]);
369 xo_close_instance("fstab");
371 xo_close_list("fstab");
373 xo_open_list("mounted");
374 for (i = 0; i < mntsize; i++) {
375 if (checkvfsname(mntbuf[i].f_fstypename,
379 (mntbuf[i].f_flags & MNT_IGNORE) != 0)
381 xo_open_instance("mounted");
383 xo_close_instance("mounted");
385 xo_close_list("mounted");
392 rmslashes(*argv, *argv);
393 if (init_flags & MNT_UPDATE) {
396 if ((mntbuf = getmntpt(*argv)) == NULL)
397 xo_errx(1, "not currently mounted %s", *argv);
399 * Only get the mntflags from fstab if both mntpoint
400 * and mntspec are identical. Also handle the special
401 * case where just '/' is mounted and 'spec' is not
402 * identical with the one from fstab ('/dev' is missing
403 * in the spec-string at boot-time).
405 if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL) {
406 if (strcmp(fs->fs_spec,
407 mntbuf->f_mntfromname) == 0 &&
409 mntbuf->f_mntonname) == 0) {
411 mntfromname = mntbuf->f_mntfromname;
412 } else if (argv[0][0] == '/' &&
413 argv[0][1] == '\0' &&
414 strcmp(fs->fs_vfstype,
415 mntbuf->f_fstypename) == 0) {
418 mntfromname = fs->fs_spec;
422 options = update_options(options, fs->fs_mntops,
425 mntfromname = mntbuf->f_mntfromname;
426 options = update_options(options, NULL,
429 rval = mountfs(mntbuf->f_fstypename, mntfromname,
430 mntbuf->f_mntonname, init_flags, options, 0);
433 if ((fs = getfsfile(*argv)) == NULL &&
434 (fs = getfsspec(*argv)) == NULL)
435 xo_errx(1, "%s: unknown special file or file system",
437 if (BADTYPE(fs->fs_type))
438 xo_errx(1, "%s has unknown file system type",
440 rval = mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file,
441 init_flags, options, fs->fs_mntops);
445 * If -t flag has not been specified, the path cannot be
446 * found, spec contains either a ':' or a '@', then assume
447 * that an NFS file system is being specified ala Sun.
448 * Check if the hostname contains only allowed characters
449 * to reduce false positives. IPv6 addresses containing
450 * ':' will be correctly parsed only if the separator is '@'.
451 * The definition of a valid hostname is taken from RFC 1034.
453 if (vfslist == NULL && ((ep = strchr(argv[0], '@')) != NULL ||
454 (ep = strchr(argv[0], ':')) != NULL)) {
457 ep = cp + strlen(cp);
461 if (!isdigit(*cp) && !isalpha(*cp) &&
462 *cp != '.' && *cp != '-' && *cp != ':')
469 rval = mountfs(vfstype,
470 argv[0], argv[1], init_flags, options, NULL);
478 * If the mount was successfully, and done by root, tell mountd the
481 if (rval == 0 && getuid() == 0)
488 ismounted(struct fstab *fs, struct statfs *mntbuf, int mntsize)
490 char realfsfile[PATH_MAX];
493 if (fs->fs_file[0] == '/' && fs->fs_file[1] == '\0')
494 /* the root file system can always be remounted */
497 /* The user may have specified a symlink in fstab, resolve the path */
498 if (realpath(fs->fs_file, realfsfile) == NULL) {
499 /* Cannot resolve the path, use original one */
500 strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile));
504 * Consider the filesystem to be mounted if:
505 * It has the same mountpoint as a mounted filesytem, and
506 * It has the same type as that same mounted filesystem, and
507 * It has the same device name as that same mounted filesystem, OR
508 * It is a nonremountable filesystem
510 for (i = mntsize - 1; i >= 0; --i)
511 if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 &&
512 strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 &&
513 (!isremountable(fs->fs_vfstype) ||
514 (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)))
520 isremountable(const char *vfsname)
524 for (cp = remountable_fs_names; *cp; cp++)
525 if (strcmp(*cp, vfsname) == 0)
531 hasopt(const char *mntopts, const char *option)
536 if (option[0] == 'n' && option[1] == 'o') {
541 optbuf = strdup(mntopts);
543 for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
544 if (opt[0] == 'n' && opt[1] == 'o') {
545 if (!strcasecmp(opt + 2, option))
547 } else if (!strcasecmp(opt, option))
555 append_arg(struct cpa *sa, char *arg)
557 if (sa->c + 1 == sa->sz) {
558 sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
559 sa->a = realloc(sa->a, sizeof(*sa->a) * sa->sz);
561 xo_errx(1, "realloc failed");
563 sa->a[++sa->c] = arg;
567 mountfs(const char *vfstype, const char *spec, const char *name, int flags,
568 const char *options, const char *mntopts)
572 char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX];
573 static struct cpa mnt_argv;
575 /* resolve the mountpoint with realpath(3) */
576 if (checkpath(name, mntpath) != 0) {
577 xo_warn("%s", mntpath);
584 optbuf = catopt(strdup(mntopts), options);
586 if (strcmp(name, "/") == 0)
588 if (flags & MNT_FORCE)
589 optbuf = catopt(optbuf, "force");
590 if (flags & MNT_RDONLY)
591 optbuf = catopt(optbuf, "ro");
594 * The mount_mfs (newfs) command uses -o to select the
595 * optimization mode. We don't pass the default "-o rw"
598 if (flags & MNT_UPDATE)
599 optbuf = catopt(optbuf, "update");
601 /* Compatibility glue. */
602 if (strcmp(vfstype, "msdos") == 0)
605 /* Construct the name of the appropriate mount command */
606 (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype);
609 append_arg(&mnt_argv, execname);
610 mangle(optbuf, &mnt_argv);
611 if (mountprog != NULL)
612 strlcpy(execname, mountprog, sizeof(execname));
614 append_arg(&mnt_argv, strdup(spec));
615 append_arg(&mnt_argv, strdup(name));
616 append_arg(&mnt_argv, NULL);
619 if (use_mountprog(vfstype))
620 xo_emit("{Lwc:exec}{:execname/%s}", execname);
622 xo_emit("{:execname/mount}{P: }{l:opts/-t}{P: }{l:opts/%s}", vfstype);
623 for (i = 1; i < mnt_argv.c; i++)
624 xo_emit("{P: }{l:opts}", mnt_argv.a[i]);
632 if (use_mountprog(vfstype)) {
633 ret = exec_mountprog(name, execname, mnt_argv.a);
635 ret = mount_fs(vfstype, mnt_argv.c, mnt_argv.a);
643 if (statfs(name, &sf) < 0) {
644 xo_warn("statfs %s", name);
648 xo_open_list("fstab");
649 xo_open_instance("fstab");
651 xo_close_instance("fstab");
652 xo_close_list("fstab");
654 xo_open_list("mounted");
655 xo_open_instance("mounted");
657 xo_close_instance("mounted");
658 xo_close_list("mounted");
666 prmount(struct statfs *sfp)
670 struct mntoptnames *o;
674 xo_emit("{:special/%hs}{L: on }{:node/%hs}{L: (}{:fstype}", sfp->f_mntfromname,
675 sfp->f_mntonname, sfp->f_fstypename);
677 flags = sfp->f_flags & MNT_VISFLAGMASK;
678 for (o = optnames; flags != 0 && o->o_opt != 0; o++)
679 if (flags & o->o_opt) {
680 xo_emit("{D:, }{l:opts}", o->o_name);
684 * Inform when file system is mounted by an unprivileged user
685 * or privileged non-root user.
687 if ((flags & MNT_USER) != 0 || sfp->f_owner != 0) {
688 xo_emit("{D:, }{L:mounted by }");
689 if ((pw = getpwuid(sfp->f_owner)) != NULL)
690 xo_emit("{:mounter/%hs}", pw->pw_name);
692 xo_emit("{:mounter/%hs}", sfp->f_owner);
695 if (sfp->f_syncwrites != 0 || sfp->f_asyncwrites != 0) {
696 xo_open_container("writes");
697 xo_emit("{D:, }{Lwc:writes}{Lw:sync}{w:sync/%ju}{Lw:async}{:async/%ju}",
698 (uintmax_t)sfp->f_syncwrites,
699 (uintmax_t)sfp->f_asyncwrites);
700 xo_close_container("writes");
702 if (sfp->f_syncreads != 0 || sfp->f_asyncreads != 0) {
703 xo_open_container("reads");
704 xo_emit("{D:, }{Lwc:reads}{Lw:sync}{w:sync/%ju}{Lw:async}{:async/%ju}",
705 (uintmax_t)sfp->f_syncreads,
706 (uintmax_t)sfp->f_asyncreads);
707 xo_close_container("reads");
709 if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) {
710 fsidbuf = malloc(sizeof(sfp->f_fsid) * 2 + 1);
712 xo_errx(1, "malloc failed");
713 for (i = 0; i < sizeof(sfp->f_fsid); i++)
714 sprintf(&fsidbuf[i * 2], "%02x",
715 ((u_char *)&sfp->f_fsid)[i]);
716 fsidbuf[i * 2] = '\0';
717 xo_emit("{D:, }{Lw:fsid}{:fsid}", fsidbuf);
725 getmntpt(const char *name)
727 struct statfs *mntbuf;
730 mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
731 for (i = mntsize - 1; i >= 0; i--) {
732 if (strcmp(mntbuf[i].f_mntfromname, name) == 0 ||
733 strcmp(mntbuf[i].f_mntonname, name) == 0)
740 catopt(char *s0, const char *s1)
744 if (s1 == NULL || *s1 == '\0')
748 if (asprintf(&cp, "%s,%s", s0, s1) == -1)
749 xo_errx(1, "asprintf failed");
759 mangle(char *options, struct cpa *a)
763 for (s = options; (p = strsep(&s, ",")) != NULL;)
765 if (strcmp(p, "noauto") == 0) {
767 * Do not pass noauto option to nmount().
768 * or external mount program. noauto is
769 * only used to prevent mounting a filesystem
770 * when 'mount -a' is specified, and is
771 * not a real mount option.
774 } else if (strcmp(p, "late") == 0) {
776 * "late" is used to prevent certain file
777 * systems from being mounted before late
778 * in the boot cycle; for instance,
779 * loopback NFS mounts can't be mounted
780 * before mountd starts.
783 } else if (strcmp(p, "failok") == 0) {
785 * "failok" is used to prevent certain file
786 * systems from being causing the system to
787 * drop into single user mode in the boot
788 * cycle, and is not a real mount option.
791 } else if (strncmp(p, "mountprog", 9) == 0) {
793 * "mountprog" is used to force the use of
794 * userland mount programs.
796 val = strchr(p, '=');
800 mountprog = strdup(val);
803 if (mountprog == NULL) {
804 xo_errx(1, "Need value for -o mountprog");
807 } else if (strcmp(p, "userquota") == 0) {
809 } else if (strncmp(p, userquotaeq,
810 sizeof(userquotaeq) - 1) == 0) {
812 } else if (strcmp(p, "groupquota") == 0) {
814 } else if (strncmp(p, groupquotaeq,
815 sizeof(groupquotaeq) - 1) == 0) {
817 } else if (*p == '-') {
822 append_arg(a, p + 1);
825 append_arg(a, strdup("-o"));
833 update_options(char *opts, char *fstab, int curflags)
837 char *expopt, *newopt, *tmpopt;
842 /* remove meta options from list */
843 remopt(fstab, MOUNT_META_OPTION_FSTAB);
844 remopt(fstab, MOUNT_META_OPTION_CURRENT);
845 cur = flags2opts(curflags);
848 * Expand all meta-options passed to us first.
851 for (p = opts; (o = strsep(&p, ",")) != NULL;) {
852 if (strcmp(MOUNT_META_OPTION_FSTAB, o) == 0)
853 expopt = catopt(expopt, fstab);
854 else if (strcmp(MOUNT_META_OPTION_CURRENT, o) == 0)
855 expopt = catopt(expopt, cur);
857 expopt = catopt(expopt, o);
863 * Remove previous contradictory arguments. Given option "foo" we
864 * remove all the "nofoo" options. Given "nofoo" we remove "nonofoo"
865 * and "foo" - so we can deal with possible options like "notice".
868 for (p = expopt; (o = strsep(&p, ",")) != NULL;) {
869 if ((tmpopt = malloc( strlen(o) + 2 + 1 )) == NULL)
870 xo_errx(1, "malloc failed");
872 strcpy(tmpopt, "no");
874 remopt(newopt, tmpopt);
877 if (strncmp("no", o, 2) == 0)
880 newopt = catopt(newopt, o);
888 remopt(char *string, const char *opt)
892 if (string == NULL || *string == '\0' || opt == NULL || *opt == '\0')
897 for (p = string; (o = strsep(&p, ",")) != NULL;) {
898 if (strcmp(opt, o) != 0) {
899 if (*r == ',' && *o != '\0')
901 while ((*r++ = *o++) != '\0')
913 xo_error("%s\n%s\n%s\n",
914 "usage: mount [-adflpruvw] [-F fstab] [-o options] [-t ufs | external_type]",
915 " mount [-dfpruvw] special | node",
916 " mount [-dfpruvw] [-o options] [-t ufs | external_type] special node");
921 putfsent(struct statfs *ent)
928 /* flags2opts() doesn't return the "rw" option. */
929 if ((ent->f_flags & MNT_RDONLY) != 0)
932 rw = catopt(NULL, "rw");
934 opts = flags2opts(ent->f_flags);
935 opts = catopt(rw, opts);
937 if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
938 strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
939 strlcpy(ent->f_mntfromname,
940 (strnstr(ent->f_mntfromname, ":", 8) +1),
941 sizeof(ent->f_mntfromname));
944 l = strlen(ent->f_mntfromname);
945 xo_emit("{:device}{P:/%s}{P:/%s}{P:/%s}",
949 l < 24 ? "\t" : " ");
950 l = strlen(ent->f_mntonname);
951 xo_emit("{:mntpoint}{P:/%s}{P:/%s}{P:/%s}",
955 l < 24 ? "\t" : " ");
956 xo_emit("{:fstype}{P:\t}", ent->f_fstypename);
958 xo_emit("{:opts}{P:/%s}", opts,
962 if ((fst = getfsspec(ent->f_mntfromname)))
963 xo_emit("{P:\t}{n:dump/%u}{P: }{n:pass/%u}\n",
964 fst->fs_freq, fst->fs_passno);
965 else if ((fst = getfsfile(ent->f_mntonname)))
966 xo_emit("{P:\t}{n:dump/%u}{P: }{n:pass/%u}\n",
967 fst->fs_freq, fst->fs_passno);
968 else if (strcmp(ent->f_fstypename, "ufs") == 0) {
969 if (strcmp(ent->f_mntonname, "/") == 0)
970 xo_emit("{P:\t}{n:dump/1}{P: }{n:pass/1}\n");
972 xo_emit("{P:\t}{n:dump/2}{P: }{n:pass/2}\n");
974 xo_emit("{P:\t}{n:dump/0}{P: }{n:pass/0}\n");
979 flags2opts(int flags)
985 if (flags & MNT_RDONLY) res = catopt(res, "ro");
986 if (flags & MNT_SYNCHRONOUS) res = catopt(res, "sync");
987 if (flags & MNT_NOEXEC) res = catopt(res, "noexec");
988 if (flags & MNT_NOSUID) res = catopt(res, "nosuid");
989 if (flags & MNT_UNION) res = catopt(res, "union");
990 if (flags & MNT_ASYNC) res = catopt(res, "async");
991 if (flags & MNT_NOATIME) res = catopt(res, "noatime");
992 if (flags & MNT_NOCLUSTERR) res = catopt(res, "noclusterr");
993 if (flags & MNT_NOCLUSTERW) res = catopt(res, "noclusterw");
994 if (flags & MNT_NOSYMFOLLOW) res = catopt(res, "nosymfollow");
995 if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir");
996 if (flags & MNT_MULTILABEL) res = catopt(res, "multilabel");
997 if (flags & MNT_ACLS) res = catopt(res, "acls");
998 if (flags & MNT_NFS4ACLS) res = catopt(res, "nfsv4acls");
999 if (flags & MNT_UNTRUSTED) res = catopt(res, "untrusted");
1000 if (flags & MNT_NOCOVER) res = catopt(res, "nocover");
1001 if (flags & MNT_EMPTYDIR) res = catopt(res, "emptydir");