summaryrefslogtreecommitdiffstats
path: root/sbin/mount_nfs
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2008-02-18 00:05:50 +0000
committeryar <yar@FreeBSD.org>2008-02-18 00:05:50 +0000
commitcc89c56074266679b35f25b6c747020fac27c22a (patch)
tree32e991a786c6ca99116d7ed98ce7eada33e72309 /sbin/mount_nfs
parent2304f6c8b82cef35ad0a189f5646394a21f9d371 (diff)
downloadFreeBSD-src-cc89c56074266679b35f25b6c747020fac27c22a.zip
FreeBSD-src-cc89c56074266679b35f25b6c747020fac27c22a.tar.gz
Don't forget to prepare string options for nmount(2).
Otherwise things won't work as intended, e.g., it'll be impossible to upgrade NFS root mount to read-write. Reported by: kris
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r--sbin/mount_nfs/mount_nfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 48c0a1f..edebc2e 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -283,7 +283,7 @@ main(int argc, char *argv[])
struct iovec *iov;
int mntflags, altflags, num;
int iovlen;
- char *name, *p, *spec, *fstype;
+ char *name, *p, *spec, *fstype, *val;
char mntpath[MAXPATHLEN], errmsg[255];
mntflags = 0;
@@ -380,6 +380,13 @@ main(int argc, char *argv[])
else if (mountmode == V3)
altflags |= ALTF_NFSV3;
getmntopts(optarg, mopts, &mntflags, &altflags);
+ p = strchr(optarg, '=');
+ val = NULL;
+ if (p != NULL) {
+ *p = '\0';
+ val = p + 1;
+ }
+ build_iovec(&iov, &iovlen, optarg, val, (size_t)-1);
set_flags(&altflags, &nfsargsp->flags, FALSE);
/*
* Handle altflags which don't map directly to
OpenPOWER on IntegriCloud