diff options
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index aa85868..6907b27 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -253,7 +253,7 @@ main(int argc, char *argv[]) struct iovec *iov; int mntflags, altflags, num; int iovlen; - char *name, *p, *spec; + char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN]; mntflags = 0; @@ -263,6 +263,12 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; + fstype = strrchr(argv[0], '_'); + if (fstype == NULL) + errx(EX_USAGE, "argv[0] must end in _fstype"); + + ++fstype; + while ((c = getopt(argc, argv, "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1) switch (c) { @@ -461,7 +467,7 @@ main(int argc, char *argv[]) (void)checkpath(name, mntpath); build_iovec(&iov, &iovlen, "nfs_args", nfsargsp, sizeof(*nfsargsp)); - build_iovec(&iov, &iovlen, "fstype", "nfs", (size_t)-1); + build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); if (nmount(iov, iovlen, mntflags)) |