From e43878f43c377ac289869d75122d0fb5cdf27114 Mon Sep 17 00:00:00 2001 From: jh Date: Tue, 3 May 2011 16:00:26 +0000 Subject: [PATCH] Don't pass empty mount options to nmount(2). Reviewed by: pjd MFC after: 2 weeks --- cddl/compat/opensolaris/misc/zmount.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cddl/compat/opensolaris/misc/zmount.c b/cddl/compat/opensolaris/misc/zmount.c index b4f99e3be9fd..d46b378ea92a 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);