summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-11-01 23:51:53 +0000
committerwollman <wollman@FreeBSD.org>1994-11-01 23:51:53 +0000
commitf22ba017a05b76c7d6527ba987fe81cdef085ced (patch)
treef614541c69f463075bbc04969273cb64b172d603
parent4d89ead91e74e5a8e60f0f16733d9d8c15d82542 (diff)
downloadFreeBSD-src-f22ba017a05b76c7d6527ba987fe81cdef085ced.zip
FreeBSD-src-f22ba017a05b76c7d6527ba987fe81cdef085ced.tar.gz
Add support for filesystem-specific `-o' options, and re-implement the
most common cd9660 and nfs options like God intended them. (It is now possible to say mount -o ro,soft,bg,intr there:/foo/bar /foo/bar again.) This whole getmntopt() business is an incredible botch; it never should have been anything more than a wrapper around getsubopt(3). Because if the way the current hackaround is implemented, options which take arguments (like the old `rsize' and `wsize') are still unavailable, and must be accessed the new, broken way. (It's unimaginable how Berkeley managed to screw up one of the few things about NFS that Sun actually got right to begin with!)
-rw-r--r--sbin/i386/mount_msdos/mount_msdos.c4
-rw-r--r--sbin/mount/getmntopts.315
-rw-r--r--sbin/mount/getmntopts.c14
-rw-r--r--sbin/mount/mntopts.h30
-rw-r--r--sbin/mount/mount_ufs.c2
-rw-r--r--sbin/mount_cd9660/mount_cd9660.c5
-rw-r--r--sbin/mount_fdesc/mount_fdesc.c2
-rw-r--r--sbin/mount_ifs/getmntopts.315
-rw-r--r--sbin/mount_ifs/getmntopts.c14
-rw-r--r--sbin/mount_ifs/mntopts.h30
-rw-r--r--sbin/mount_ifs/mount_ufs.c2
-rw-r--r--sbin/mount_kernfs/mount_kernfs.c2
-rw-r--r--sbin/mount_lfs/mount_lfs.c2
-rw-r--r--sbin/mount_msdos/mount_msdos.c4
-rw-r--r--sbin/mount_msdosfs/mount_msdosfs.c4
-rw-r--r--sbin/mount_nfs/mount_nfs.c67
-rw-r--r--sbin/mount_null/mount_null.c2
-rw-r--r--sbin/mount_nullfs/mount_nullfs.c2
-rw-r--r--sbin/mount_portal/mount_portal.c2
-rw-r--r--sbin/mount_portalfs/mount_portalfs.c2
-rw-r--r--sbin/mount_procfs/mount_procfs.c2
-rw-r--r--sbin/mount_umap/mount_umap.c2
-rw-r--r--sbin/mount_umapfs/mount_umapfs.c2
-rw-r--r--sbin/mount_union/mount_union.c2
-rw-r--r--sbin/mount_unionfs/mount_unionfs.c2
-rw-r--r--sbin/newfs/newfs.c2
-rw-r--r--usr.sbin/mount_portalfs/mount_portalfs.c2
27 files changed, 169 insertions, 65 deletions
diff --git a/sbin/i386/mount_msdos/mount_msdos.c b/sbin/i386/mount_msdos/mount_msdos.c
index 9cac3ff..db652ae 100644
--- a/sbin/i386/mount_msdos/mount_msdos.c
+++ b/sbin/i386/mount_msdos/mount_msdos.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: mount_msdos.c,v 1.1 1994/09/19 15:30:36 dfr Exp $";
+static char rcsid[] = "$Id: mount_msdos.c,v 1.2 1994/09/22 22:16:35 wollman Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
@@ -87,7 +87,7 @@ main(argc, argv)
set_mask = 1;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount/getmntopts.3 b/sbin/mount/getmntopts.3
index 642c57a..c1bd25a 100644
--- a/sbin/mount/getmntopts.3
+++ b/sbin/mount/getmntopts.3
@@ -40,7 +40,7 @@
.Sh SYNOPSIS
.Fd #include <mntopts.h>
.Ft void
-.Fn getmntopts "char *options" "struct mntopt *mopts" "int *flagp"
+.Fn getmntopts "char *options" "struct mntopt *mopts" "int *flagp" "int *altflagp"
.Sh DESCRIPTION
The
.Nm getmntopts
@@ -54,8 +54,13 @@ is broken down into a sequence of comma separated tokens.
Each token is looked up in the table described by
.Dv mopts
and the bits in
-the word referenced by
+the word referenced by either
.Dv flagp
+or
+.Dv altflagp
+(depending on the
+.Dv m_altloc
+field of the option's table entry)
are updated.
The flag word is not initialized by
.Nm getmntopt .
@@ -67,6 +72,7 @@ struct mntopt {
char *m_option; /* option name */
int m_inverse; /* is this a negative option, eg "dev" */
int m_flag; /* bit to set, eg MNT_RDONLY */
+ int m_altloc; /* non-zero to use altflagp rather than flagp */
};
.Ed
.Pp
@@ -100,6 +106,11 @@ by the letters
The
.Dv m_inverse
flag causes these two operations to be reversed.
+.It Fa m_altloc
+the bit should be set or cleared in
+.Dv altflagp
+rather than
+.Dv flagp .
.El
.Pp
Each of the user visible
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c
index 1af5e0f..75c75b2 100644
--- a/sbin/mount/getmntopts.c
+++ b/sbin/mount/getmntopts.c
@@ -46,15 +46,19 @@ static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94";
#include "mntopts.h"
+int getmnt_silent = 0;
+
void
-getmntopts(options, m0, flagp)
+getmntopts(options, m0, flagp, altflagp)
const char *options;
const struct mntopt *m0;
int *flagp;
+ int *altflagp;
{
const struct mntopt *m;
int negative, len;
char *opt, *optbuf;
+ int *thisflagp;
/* Copy option string, since it is about to be torn asunder... */
if ((optbuf = strdup(options)) == NULL)
@@ -80,12 +84,14 @@ getmntopts(options, m0, flagp)
/* Save flag, or fail if option is not recognised. */
if (m->m_option) {
+ thisflagp = m->m_altloc ? altflagp : flagp;
if (negative == m->m_inverse)
- *flagp |= m->m_flag;
+ *thisflagp |= m->m_flag;
else
- *flagp &= ~m->m_flag;
- } else
+ *thisflagp &= ~m->m_flag;
+ } else if(!getmnt_silent) {
errx(1, "-o %s: option not supported", opt);
+ }
}
free(optbuf);
diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h
index ec2c6d0..ba792fa 100644
--- a/sbin/mount/mntopts.h
+++ b/sbin/mount/mntopts.h
@@ -37,28 +37,29 @@ struct mntopt {
const char *m_option; /* option name */
int m_inverse; /* if a negative option, eg "dev" */
int m_flag; /* bit to set, eg. MNT_RDONLY */
+ int m_altloc; /* zero if this is a real mount flag */
};
/* User-visible MNT_ flags. */
-#define MOPT_ASYNC { "async", 0, MNT_ASYNC }
-#define MOPT_NODEV { "dev", 1, MNT_NODEV }
-#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC }
-#define MOPT_NOSUID { "suid", 1, MNT_NOSUID }
-#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY }
-#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
-#define MOPT_UNION { "union", 0, MNT_UNION }
+#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
+#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 }
+#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
+#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
+#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 }
+#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 }
+#define MOPT_UNION { "union", 0, MNT_UNION, 0 }
/* Skip this options without any action (needed for checkquota/quotaon) */
-#define MOPT_UQUOTA { "userquota", 0, 0 }
-#define MOPT_GQUOTA { "groupquota", 0, 0 }
+#define MOPT_UQUOTA { "userquota", 0, 0, 0 }
+#define MOPT_GQUOTA { "groupquota", 0, 0, 0 }
/* Control flags. */
-#define MOPT_FORCE { "force", 1, MNT_FORCE }
-#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
+#define MOPT_FORCE { "force", 1, MNT_FORCE, 0 }
+#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
/* Support for old-style "ro", "rw" flags. */
-#define MOPT_RO { "ro", 0, MNT_RDONLY }
-#define MOPT_RW { "rw", 1, MNT_RDONLY }
+#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 }
+#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 }
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
@@ -73,4 +74,5 @@ struct mntopt {
MOPT_RDONLY, \
MOPT_UNION
-void getmntopts __P((const char *, const struct mntopt *, int *));
+void getmntopts __P((const char *, const struct mntopt *, int *, int *));
+extern int getmnt_silent;
diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c
index 37d4756..48be222 100644
--- a/sbin/mount/mount_ufs.c
+++ b/sbin/mount/mount_ufs.c
@@ -81,7 +81,7 @@ mount_ufs(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c
index 2dfe3e6..e909177 100644
--- a/sbin/mount_cd9660/mount_cd9660.c
+++ b/sbin/mount_cd9660/mount_cd9660.c
@@ -63,6 +63,9 @@ static char sccsid[] = "@(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94";
struct mntopt mopts[] = {
MOPT_STDOPTS,
MOPT_UPDATE,
+ { "extatt", 0, ISOFSMNT_EXTATT, 1 },
+ { "gens", 0, ISOFSMNT_GENS, 1 },
+ { "rrip", 1, ISOFSMNT_NORRIP, 1 },
{ NULL }
};
@@ -88,7 +91,7 @@ main(argc, argv)
opts |= ISOFSMNT_GENS;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, &opts);
break;
case 'r':
opts |= ISOFSMNT_NORRIP;
diff --git a/sbin/mount_fdesc/mount_fdesc.c b/sbin/mount_fdesc/mount_fdesc.c
index bf7f615..897886d 100644
--- a/sbin/mount_fdesc/mount_fdesc.c
+++ b/sbin/mount_fdesc/mount_fdesc.c
@@ -75,7 +75,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_ifs/getmntopts.3 b/sbin/mount_ifs/getmntopts.3
index 642c57a..c1bd25a 100644
--- a/sbin/mount_ifs/getmntopts.3
+++ b/sbin/mount_ifs/getmntopts.3
@@ -40,7 +40,7 @@
.Sh SYNOPSIS
.Fd #include <mntopts.h>
.Ft void
-.Fn getmntopts "char *options" "struct mntopt *mopts" "int *flagp"
+.Fn getmntopts "char *options" "struct mntopt *mopts" "int *flagp" "int *altflagp"
.Sh DESCRIPTION
The
.Nm getmntopts
@@ -54,8 +54,13 @@ is broken down into a sequence of comma separated tokens.
Each token is looked up in the table described by
.Dv mopts
and the bits in
-the word referenced by
+the word referenced by either
.Dv flagp
+or
+.Dv altflagp
+(depending on the
+.Dv m_altloc
+field of the option's table entry)
are updated.
The flag word is not initialized by
.Nm getmntopt .
@@ -67,6 +72,7 @@ struct mntopt {
char *m_option; /* option name */
int m_inverse; /* is this a negative option, eg "dev" */
int m_flag; /* bit to set, eg MNT_RDONLY */
+ int m_altloc; /* non-zero to use altflagp rather than flagp */
};
.Ed
.Pp
@@ -100,6 +106,11 @@ by the letters
The
.Dv m_inverse
flag causes these two operations to be reversed.
+.It Fa m_altloc
+the bit should be set or cleared in
+.Dv altflagp
+rather than
+.Dv flagp .
.El
.Pp
Each of the user visible
diff --git a/sbin/mount_ifs/getmntopts.c b/sbin/mount_ifs/getmntopts.c
index 1af5e0f..75c75b2 100644
--- a/sbin/mount_ifs/getmntopts.c
+++ b/sbin/mount_ifs/getmntopts.c
@@ -46,15 +46,19 @@ static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94";
#include "mntopts.h"
+int getmnt_silent = 0;
+
void
-getmntopts(options, m0, flagp)
+getmntopts(options, m0, flagp, altflagp)
const char *options;
const struct mntopt *m0;
int *flagp;
+ int *altflagp;
{
const struct mntopt *m;
int negative, len;
char *opt, *optbuf;
+ int *thisflagp;
/* Copy option string, since it is about to be torn asunder... */
if ((optbuf = strdup(options)) == NULL)
@@ -80,12 +84,14 @@ getmntopts(options, m0, flagp)
/* Save flag, or fail if option is not recognised. */
if (m->m_option) {
+ thisflagp = m->m_altloc ? altflagp : flagp;
if (negative == m->m_inverse)
- *flagp |= m->m_flag;
+ *thisflagp |= m->m_flag;
else
- *flagp &= ~m->m_flag;
- } else
+ *thisflagp &= ~m->m_flag;
+ } else if(!getmnt_silent) {
errx(1, "-o %s: option not supported", opt);
+ }
}
free(optbuf);
diff --git a/sbin/mount_ifs/mntopts.h b/sbin/mount_ifs/mntopts.h
index ec2c6d0..ba792fa 100644
--- a/sbin/mount_ifs/mntopts.h
+++ b/sbin/mount_ifs/mntopts.h
@@ -37,28 +37,29 @@ struct mntopt {
const char *m_option; /* option name */
int m_inverse; /* if a negative option, eg "dev" */
int m_flag; /* bit to set, eg. MNT_RDONLY */
+ int m_altloc; /* zero if this is a real mount flag */
};
/* User-visible MNT_ flags. */
-#define MOPT_ASYNC { "async", 0, MNT_ASYNC }
-#define MOPT_NODEV { "dev", 1, MNT_NODEV }
-#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC }
-#define MOPT_NOSUID { "suid", 1, MNT_NOSUID }
-#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY }
-#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
-#define MOPT_UNION { "union", 0, MNT_UNION }
+#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
+#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 }
+#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
+#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
+#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 }
+#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 }
+#define MOPT_UNION { "union", 0, MNT_UNION, 0 }
/* Skip this options without any action (needed for checkquota/quotaon) */
-#define MOPT_UQUOTA { "userquota", 0, 0 }
-#define MOPT_GQUOTA { "groupquota", 0, 0 }
+#define MOPT_UQUOTA { "userquota", 0, 0, 0 }
+#define MOPT_GQUOTA { "groupquota", 0, 0, 0 }
/* Control flags. */
-#define MOPT_FORCE { "force", 1, MNT_FORCE }
-#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
+#define MOPT_FORCE { "force", 1, MNT_FORCE, 0 }
+#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
/* Support for old-style "ro", "rw" flags. */
-#define MOPT_RO { "ro", 0, MNT_RDONLY }
-#define MOPT_RW { "rw", 1, MNT_RDONLY }
+#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 }
+#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 }
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
@@ -73,4 +74,5 @@ struct mntopt {
MOPT_RDONLY, \
MOPT_UNION
-void getmntopts __P((const char *, const struct mntopt *, int *));
+void getmntopts __P((const char *, const struct mntopt *, int *, int *));
+extern int getmnt_silent;
diff --git a/sbin/mount_ifs/mount_ufs.c b/sbin/mount_ifs/mount_ufs.c
index 37d4756..48be222 100644
--- a/sbin/mount_ifs/mount_ufs.c
+++ b/sbin/mount_ifs/mount_ufs.c
@@ -81,7 +81,7 @@ mount_ufs(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_kernfs/mount_kernfs.c b/sbin/mount_kernfs/mount_kernfs.c
index e3e2ec0..c4e72ac 100644
--- a/sbin/mount_kernfs/mount_kernfs.c
+++ b/sbin/mount_kernfs/mount_kernfs.c
@@ -75,7 +75,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_lfs/mount_lfs.c b/sbin/mount_lfs/mount_lfs.c
index b4e4d2e..9ac183a 100644
--- a/sbin/mount_lfs/mount_lfs.c
+++ b/sbin/mount_lfs/mount_lfs.c
@@ -85,7 +85,7 @@ main(argc, argv)
noclean = 1;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case 's':
short_rds = 1;
diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c
index 9cac3ff..db652ae 100644
--- a/sbin/mount_msdos/mount_msdos.c
+++ b/sbin/mount_msdos/mount_msdos.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: mount_msdos.c,v 1.1 1994/09/19 15:30:36 dfr Exp $";
+static char rcsid[] = "$Id: mount_msdos.c,v 1.2 1994/09/22 22:16:35 wollman Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
@@ -87,7 +87,7 @@ main(argc, argv)
set_mask = 1;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c
index 9cac3ff..db652ae 100644
--- a/sbin/mount_msdosfs/mount_msdosfs.c
+++ b/sbin/mount_msdosfs/mount_msdosfs.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: mount_msdos.c,v 1.1 1994/09/19 15:30:36 dfr Exp $";
+static char rcsid[] = "$Id: mount_msdos.c,v 1.2 1994/09/22 22:16:35 wollman Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
@@ -87,7 +87,7 @@ main(argc, argv)
set_mask = 1;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 900f22e..95e5f83 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -86,10 +86,41 @@ static char sccsid[] = "@(#)mount_nfs.c 8.3 (Berkeley) 3/27/94";
#include "mntopts.h"
+#define ALTF_BG 0x1
+#define ALTF_NOCONN 0x2
+#define ALTF_DUMBTIMR 0x4
+#define ALTF_INTR 0x8
+#define ALTF_KERB 0x10
+#define ALTF_NQLOOKLSE 0x20
+#define ALTF_RDIRALOOK 0x40
+#define ALTF_MYWRITE 0x80
+#define ALTF_RESVPORT 0x100
+#define ALTF_SEQPACKET 0x200
+#define ALTF_NQNFS 0x400
+#define ALTF_SOFT 0x800
+#define ALTF_TCP 0x1000
+
struct mntopt mopts[] = {
MOPT_STDOPTS,
MOPT_FORCE,
MOPT_UPDATE,
+ { "bg", 0, ALTF_BG, 1 },
+ { "conn", 1, ALTF_NOCONN, 1 },
+ { "dumbtimer", 0, ALTF_DUMBTIMR, 1 },
+ { "intr", 0, ALTF_INTR, 1 },
+#ifdef KERBEROS
+ { "kerb", 0, ALTF_KERB, 1 },
+#endif
+ { "nqlooklease", 0, ALTF_NQLOOKLSE, 1 },
+ { "rdiralook", 0, ALTF_RDIRALOOK, 1 },
+ { "mywrite", 0, ALTF_MYWRITE, 1 },
+ { "resvport", 0, ALTF_RESVPORT, 1 },
+#ifdef ISO
+ { "seqpacket", 0, ALTF_SEQPACKET, 1 },
+#endif
+ { "nqnfs", 0, ALTF_NQNFS, 1 },
+ { "soft", 0, ALTF_SOFT, 1 },
+ { "tcp", 0, ALTF_TCP, 1 },
{ NULL }
};
@@ -145,7 +176,7 @@ main(argc, argv)
register struct nfs_args *nfsargsp;
struct nfs_args nfsargs;
struct nfsd_cargs ncd;
- int mntflags, i, nfssvc_flag, num;
+ int mntflags, altflags, i, nfssvc_flag, num;
char *name, *p, *spec;
int error = 0;
struct vfsconf *vfc;
@@ -160,6 +191,7 @@ main(argc, argv)
retrycnt = DEF_RETRY;
mntflags = 0;
+ altflags = 0;
nfsargs = nfsdefargs;
nfsargsp = &nfsargs;
while ((c = getopt(argc, argv,
@@ -227,7 +259,38 @@ main(argc, argv)
break;
#endif
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, &altflags);
+ if(altflags & ALTF_BG)
+ opflags |= BGRND;
+ if(altflags & ALTF_NOCONN)
+ nfsargsp->flags |= NFSMNT_NOCONN;
+ if(altflags & ALTF_DUMBTIMR)
+ nfsargsp->flags |= NFSMNT_DUMBTIMR;
+ if(altflags & ALTF_INTR)
+ nfsargsp->flags |= NFSMNT_INT;
+#ifdef KERBEROS
+ if(altflags & ALTF_KERB)
+ nfsargsp->flags |= NFSMNT_KERB;
+#endif
+ if(altflags & ALTF_NQLOOKLSE)
+ nfsargsp->flags |= NFSMNT_NQLOOKLEASE;
+ if(altflags & ALTF_RDIRALOOK)
+ nfsargsp->flags |= NFSMNT_RDIRALOOK;
+ if(altflags & ALTF_MYWRITE)
+ nfsargsp->flags |= NFSMNT_MYWRITE;
+ if(altflags & ALTF_RESVPORT)
+ nfsargsp->flags |= NFSMNT_RESVPORT;
+#ifdef ISO
+ if(altflags & ALTF_SEQPACKET)
+ nfsargsp->sotype = SOCK_SEQPACKET;
+#endif
+ if(altflags & ALTF_NQNFS)
+ nfsargsp->flags |= NFSMNT_NQNFS;
+ if(altflags & ALTF_SOFT)
+ nfsargsp->flags |= NFSMNT_SOFT;
+ if(altflags & ALTF_TCP)
+ nfsargsp->sotype = SOCK_STREAM;
+ altflags = 0;
break;
case 'P':
nfsargsp->flags |= NFSMNT_RESVPORT;
diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c
index d042359..e9e3bd8 100644
--- a/sbin/mount_null/mount_null.c
+++ b/sbin/mount_null/mount_null.c
@@ -78,7 +78,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch(ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c
index d042359..e9e3bd8 100644
--- a/sbin/mount_nullfs/mount_nullfs.c
+++ b/sbin/mount_nullfs/mount_nullfs.c
@@ -78,7 +78,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch(ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c
index d88a38d..862027f 100644
--- a/sbin/mount_portal/mount_portal.c
+++ b/sbin/mount_portal/mount_portal.c
@@ -109,7 +109,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF) {
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
default:
error = 1;
diff --git a/sbin/mount_portalfs/mount_portalfs.c b/sbin/mount_portalfs/mount_portalfs.c
index d88a38d..862027f 100644
--- a/sbin/mount_portalfs/mount_portalfs.c
+++ b/sbin/mount_portalfs/mount_portalfs.c
@@ -109,7 +109,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF) {
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
default:
error = 1;
diff --git a/sbin/mount_procfs/mount_procfs.c b/sbin/mount_procfs/mount_procfs.c
index 6beae7f..9310ff6 100644
--- a/sbin/mount_procfs/mount_procfs.c
+++ b/sbin/mount_procfs/mount_procfs.c
@@ -75,7 +75,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF)
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case '?':
default:
diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c
index f6a7ab5..ae2ce22 100644
--- a/sbin/mount_umap/mount_umap.c
+++ b/sbin/mount_umap/mount_umap.c
@@ -105,7 +105,7 @@ main(argc, argv)
gmapfile = optarg;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case 'u':
mapfile = optarg;
diff --git a/sbin/mount_umapfs/mount_umapfs.c b/sbin/mount_umapfs/mount_umapfs.c
index f6a7ab5..ae2ce22 100644
--- a/sbin/mount_umapfs/mount_umapfs.c
+++ b/sbin/mount_umapfs/mount_umapfs.c
@@ -105,7 +105,7 @@ main(argc, argv)
gmapfile = optarg;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case 'u':
mapfile = optarg;
diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c
index 54d4df6..408a654 100644
--- a/sbin/mount_union/mount_union.c
+++ b/sbin/mount_union/mount_union.c
@@ -84,7 +84,7 @@ main(argc, argv)
args.mntflags |= UNMNT_BELOW;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case 'r':
args.mntflags &= ~UNMNT_OPMASK;
diff --git a/sbin/mount_unionfs/mount_unionfs.c b/sbin/mount_unionfs/mount_unionfs.c
index 54d4df6..408a654 100644
--- a/sbin/mount_unionfs/mount_unionfs.c
+++ b/sbin/mount_unionfs/mount_unionfs.c
@@ -84,7 +84,7 @@ main(argc, argv)
args.mntflags |= UNMNT_BELOW;
break;
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
case 'r':
args.mntflags &= ~UNMNT_OPMASK;
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 7140c54..effb821 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -291,7 +291,7 @@ main(argc, argv)
break;
case 'o':
if (mfs)
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
else {
if (strcmp(optarg, "space") == 0)
opt = FS_OPTSPACE;
diff --git a/usr.sbin/mount_portalfs/mount_portalfs.c b/usr.sbin/mount_portalfs/mount_portalfs.c
index d88a38d..862027f 100644
--- a/usr.sbin/mount_portalfs/mount_portalfs.c
+++ b/usr.sbin/mount_portalfs/mount_portalfs.c
@@ -109,7 +109,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "o:")) != EOF) {
switch (ch) {
case 'o':
- getmntopts(optarg, mopts, &mntflags);
+ getmntopts(optarg, mopts, &mntflags, 0);
break;
default:
error = 1;
OpenPOWER on IntegriCloud