From afe21afeba82a28f3378d08dfebc5b77eaabc094 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 8 Sep 2014 10:57:43 +0000 Subject: [PATCH] Make mount_smbfs(8) preserve the "automounted" mount flag. The issue here is that we have to pass this flag as a string, in iov, because it doesn't fit in mntflags, which is an int. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- contrib/smbfs/mount_smbfs/mount_smbfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/smbfs/mount_smbfs/mount_smbfs.c b/contrib/smbfs/mount_smbfs/mount_smbfs.c index 8f159ce68e0..99f1cee8ed2 100644 --- a/contrib/smbfs/mount_smbfs/mount_smbfs.c +++ b/contrib/smbfs/mount_smbfs/mount_smbfs.c @@ -81,7 +81,7 @@ main(int argc, char *argv[]) #else struct xvfsconf vfc; #endif - char *next; + char *next, *p, *val; int opt, error, mntflags, caseopt, fd; uid_t uid; gid_t gid; @@ -194,6 +194,13 @@ main(int argc, char *argv[]) }; case 'o': getmntopts(optarg, mopts, &mntflags, 0); + p = strchr(optarg, '='); + val = NULL; + if (p != NULL) { + *p = '\0'; + val = p + 1; + } + build_iovec(&iov, &iovlen, optarg, val, (size_t)-1); break; case 'c': switch (optarg[0]) {