diff options
author | jh <jh@FreeBSD.org> | 2011-05-03 16:00:26 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2011-05-03 16:00:26 +0000 |
commit | e43878f43c377ac289869d75122d0fb5cdf27114 (patch) | |
tree | 7225007572f854688f41bdc9e01eed98d1983b8a /cddl/compat | |
parent | 2f3429a5d8c5c865da9d6a9c98b99d6c894e9a08 (diff) | |
download | FreeBSD-src-e43878f43c377ac289869d75122d0fb5cdf27114.zip FreeBSD-src-e43878f43c377ac289869d75122d0fb5cdf27114.tar.gz |
Don't pass empty mount options to nmount(2).
Reviewed by: pjd
MFC after: 2 weeks
Diffstat (limited to 'cddl/compat')
-rw-r--r-- | cddl/compat/opensolaris/misc/zmount.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cddl/compat/opensolaris/misc/zmount.c b/cddl/compat/opensolaris/misc/zmount.c index b4f99e3..d46b378 100644 --- a/cddl/compat/opensolaris/misc/zmount.c +++ b/cddl/compat/opensolaris/misc/zmount.c @@ -98,8 +98,10 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype, build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1); - for (p = optstr; p != NULL; strsep(&p, ",/ ")) - build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + for (p = optstr; p != NULL; strsep(&p, ",/ ")) { + if (*p != '\0') + build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + } rv = nmount(iov, iovlen, 0); free(optstr); return (rv); |