Skip to content

Commit d5ff6b2

Browse files
author
Jason Hoos
committed
Explicitly set umask before invoking vmrun in vmwarefusion
For some reason, invoking vmrun with the nogui option doesn't work right if umask is set to not allow world-readable permissions by default. This seems to be true at least in VMware Fusion 7.0.x through 8.0.1. As a workaround, the driver now explicitly sets the umask to 022 before invoking vmrun. Signed-off-by: Jason Hoos <jhoos@maestrohealth.com>
1 parent fe5a722 commit d5ff6b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/vmwarefusion/vmrun.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"os/exec"
1313
"path/filepath"
1414
"strings"
15+
"syscall"
1516

1617
"github.com/docker/machine/libmachine/log"
1718
)
@@ -36,6 +37,9 @@ func setVmwareCmd(cmd string) string {
3637
}
3738

3839
func vmrun(args ...string) (string, string, error) {
40+
// vmrun with nogui on VMware Fusion through at least 8.0.1 doesn't work right
41+
// if the umask is set to not allow world-readable permissions
42+
_ = syscall.Umask(022)
3943
cmd := exec.Command(vmrunbin, args...)
4044
if os.Getenv("MACHINE_DEBUG") != "" {
4145
cmd.Stdout = os.Stdout

0 commit comments

Comments
 (0)