mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
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.
This commit is contained in:
parent
5c78394299
commit
975d2bedb6
25 changed files with 40 additions and 341 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue