diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 19:33:20 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 19:59:51 +1000 |
commit | 975d2bedb67c0c87203cfc7bdf2cd67d6d40d0f3 (patch) | |
tree | 8e208fc96d560ab50a8c450a337eaa29b7db0246 /pkg/integration | |
parent | 5c7839429909c411504351da8c1b204b3f5fa2f2 (diff) |
Remove secureexec package
From the go 1.19 release notes:
Command and LookPath no longer allow results from a PATH search to be found relative to the current directory. This removes a common source of security problems but may also break existing programs that depend on using, say, exec.Command("prog") to run a binary named prog (or, on Windows, prog.exe) in the current directory. See the os/exec package documentation for information about how best to update such programs.
Diffstat (limited to 'pkg/integration')
-rw-r--r-- | pkg/integration/clients/tui.go | 6 | ||||
-rw-r--r-- | pkg/integration/components/shell.go | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/pkg/integration/clients/tui.go b/pkg/integration/clients/tui.go index 78180cae6..47f1a2dc2 100644 --- a/pkg/integration/clients/tui.go +++ b/pkg/integration/clients/tui.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "os/exec" "path/filepath" "strings" @@ -13,7 +14,6 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/integration/components" "github.com/jesseduffield/lazygit/pkg/integration/tests" - "github.com/jesseduffield/lazygit/pkg/secureexec" "github.com/samber/lo" ) @@ -124,7 +124,7 @@ func RunTUI() { return nil } - cmd := secureexec.Command("sh", "-c", fmt.Sprintf("code -r pkg/integration/tests/%s.go", currentTest.Name())) + cmd := exec.Command("sh", "-c", fmt.Sprintf("code -r pkg/integration/tests/%s.go", currentTest.Name())) if err := cmd.Run(); err != nil { return err } @@ -140,7 +140,7 @@ func RunTUI() { return nil } - cmd := secureexec.Command("sh", "-c", fmt.Sprintf("code test/results/%s", currentTest.Name())) + cmd := exec.Command("sh", "-c", fmt.Sprintf("code test/results/%s", currentTest.Name())) if err := cmd.Run(); err != nil { return err } diff --git a/pkg/integration/components/shell.go b/pkg/integration/components/shell.go index ce98e575a..51fa2310b 100644 --- a/pkg/integration/components/shell.go +++ b/pkg/integration/components/shell.go @@ -4,10 +4,9 @@ import ( "fmt" "io" "os" + "os/exec" "path/filepath" "runtime" - - "github.com/jesseduffield/lazygit/pkg/secureexec" ) // this is for running shell commands, mostly for the sake of setting up the repo @@ -44,7 +43,7 @@ func (self *Shell) RunCommandExpectError(args []string) *Shell { } func (self *Shell) runCommandWithOutput(args []string) (string, error) { - cmd := secureexec.Command(args[0], args[1:]...) + cmd := exec.Command(args[0], args[1:]...) cmd.Env = os.Environ() cmd.Dir = self.dir @@ -61,7 +60,7 @@ func (self *Shell) RunShellCommand(cmdStr string) *Shell { shellArg = "/C" } - cmd := secureexec.Command(shell, shellArg, cmdStr) + cmd := exec.Command(shell, shellArg, cmdStr) cmd.Env = os.Environ() cmd.Dir = self.dir |