From b19cea9e3b4d5bcf46310632906e37f5163c4bed Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Thu, 29 Apr 2021 15:07:44 -0700 Subject: [PATCH] Allow spaces in NFS shares Signed-off-by: Jan Dubois --- pkg/hyperkit/driver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/hyperkit/driver.go b/pkg/hyperkit/driver.go index 6d82f71..2a7ee50 100644 --- a/pkg/hyperkit/driver.go +++ b/pkg/hyperkit/driver.go @@ -546,7 +546,7 @@ func (d *Driver) setupNFSShare() error { mountPoint = sharePaths[1] } mountCommands += fmt.Sprintf("sudo mkdir -p %s\\n", mountPoint) - mountCommands += fmt.Sprintf("sudo mount -t nfs -o vers=3,noacl,async %s:%s %s\\n", hostIP, localPath, mountPoint) + mountCommands += fmt.Sprintf("sudo mount -t nfs -o vers=3,noacl,async '%s:%s' %s\\n", hostIP, localPath, mountPoint) } if _, err := self(exportsAddCmd...); err != nil { @@ -633,7 +633,7 @@ func AddNFSExports(args ...string) error { ip := args[2] args = args[3:] - export := fmt.Sprintf("%s %s -alldirs -mapall=%s", path, ip, user) + export := fmt.Sprintf("%q %s -alldirs -mapall=%s", path, ip, user) if _, err := nfsexports.Add("", ident, export); err != nil { if strings.Contains(err.Error(), "conflicts with existing export") { fmt.Fprintf(os.Stderr, "Conflicting NFS Share not setup and ignored: %v", err)