From 10a2a5c81f082b9f81c8c5c7e3d31b6169d48119 Mon Sep 17 00:00:00 2001 From: Bryce Palmer Date: Thu, 3 Jun 2021 20:23:28 -0400 Subject: [PATCH 1/2] update the file/dir permissions upon creation --- subcommands/upgrade_sc.go | 4 ++-- utils/docker.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subcommands/upgrade_sc.go b/subcommands/upgrade_sc.go index 175e658..d297b52 100644 --- a/subcommands/upgrade_sc.go +++ b/subcommands/upgrade_sc.go @@ -205,7 +205,7 @@ func (ic *UpgradeCommand) Run() error { if vol.Path != "" { if _, err := os.Stat(ed + vol.Path); err != nil { if os.IsNotExist(err) { - err = os.MkdirAll(ed+vol.Path, 0755) + err = os.MkdirAll(ed+vol.Path, 0765) if err != nil { return err @@ -222,7 +222,7 @@ func (ic *UpgradeCommand) Run() error { } //Recreate the directory - err = os.MkdirAll(ed+vol.Path, 0755) + err = os.MkdirAll(ed+vol.Path, 0765) if err != nil { return err diff --git a/utils/docker.go b/utils/docker.go index cc648cf..21b56dd 100644 --- a/utils/docker.go +++ b/utils/docker.go @@ -153,7 +153,7 @@ func CopyFromContainer(source string, dest string, containerID string) error { if _, err = os.Stat(path); err != nil { if os.IsNotExist(err) { //Make the directory - err = os.MkdirAll(path, info.Mode()) + err = os.MkdirAll(path, 0765) } else { return err } @@ -161,7 +161,7 @@ func CopyFromContainer(source string, dest string, containerID string) error { } else { //Create the file and open it in the destination path on the host - file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, info.Mode()) + file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0765) //Check for errors if err != nil { From 9f9ae9399698beb3025ab18c90a85632236f3cbd Mon Sep 17 00:00:00 2001 From: Bryce Palmer Date: Thu, 3 Jun 2021 20:25:10 -0400 Subject: [PATCH 2/2] typo fix --- subcommands/upgrade_sc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subcommands/upgrade_sc.go b/subcommands/upgrade_sc.go index d297b52..d54ebe1 100644 --- a/subcommands/upgrade_sc.go +++ b/subcommands/upgrade_sc.go @@ -37,7 +37,7 @@ func (ic *UpgradeCommand) Name() string { //Init - Parses and Populates values of the Upgrade subcommand func (ic *UpgradeCommand) Init(args []string) error { if len(args) <= 0 { - fmt.Println("No package specified, upgrading all currently Upgradeed packages.") + fmt.Println("No package specified, upgrading all currently installed packages.") } else { ic.name = args[0] } @@ -86,7 +86,7 @@ func (ic *UpgradeCommand) Run() error { return errors.New("Could not find package " + ic.name + " in the package list") } - //Check if the corresponding package image is already Upgradeed + //Check if the corresponding package image is already installed imgExist, err := utils.ImageExists(pack.Image) //Check for errors @@ -94,7 +94,7 @@ func (ic *UpgradeCommand) Run() error { return err } - //If the image exists the package is already Upgradeed + //If the image exists the package is already installed if !imgExist { return errors.New("Package: " + pack.Name + " is not installed. It must be installed before it can be upgraded.") }