From 34191b6d6ef0dfe41b958ff5502d60c2e7aea603 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 12 Mar 2014 17:50:38 -0700 Subject: [PATCH 1/2] fix(workspace): Create workspace dir with permissions 0755 --- cloudinit/workspace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudinit/workspace.go b/cloudinit/workspace.go index c63d8c0..29e8df0 100644 --- a/cloudinit/workspace.go +++ b/cloudinit/workspace.go @@ -15,7 +15,7 @@ func PrepWorkspace(workspace string) error { return fmt.Errorf("%s is not a directory", workspace) } } else { - err = os.MkdirAll(workspace, 0644) + err = os.MkdirAll(workspace, 0755) if err != nil { return err } @@ -29,7 +29,7 @@ func PrepWorkspace(workspace string) error { return fmt.Errorf("%s is not a directory", scripts) } } else { - err = os.Mkdir(scripts, 0644) + err = os.Mkdir(scripts, 0755) if err != nil { return err } From fcc2e044b1f9d1196cbfb90fd9601ab6ba854d95 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 12 Mar 2014 17:51:10 -0700 Subject: [PATCH 2/2] fix(workspace): Persist scripts with proper file permissions --- cloudinit/workspace.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudinit/workspace.go b/cloudinit/workspace.go index 29e8df0..9659765 100644 --- a/cloudinit/workspace.go +++ b/cloudinit/workspace.go @@ -62,5 +62,5 @@ func PersistScriptInWorkspace(script Script, workspace string) (string, error) { func PersistScriptUnitNameInWorkspace(name string, workspace string) error { unitPath := path.Join(workspace, "scripts", "unit-name") - return ioutil.WriteFile(unitPath, []byte(name), 644) + return ioutil.WriteFile(unitPath, []byte(name), 0644) }