common/hexec: Remove github.com/cli/safeexec

We began using the safeexec package in v0.79.1 to address
https://github.com/gohugoio/hugo/security/advisories/GHSA-8j34-9876-pvfq.

The vulnerability was addressed by the Go team in 1.19, so the safeexec
package is no longer needed.

Closes #13516
This commit is contained in:
Joe Mooring 2025-03-22 12:26:41 -07:00 committed by Bjørn Erik Pedersen
parent f34cdc382a
commit a6bd67793b
5 changed files with 12 additions and 27 deletions

View file

@ -19,11 +19,11 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/gohugoio/hugo/common/hexec"
"github.com/gohugoio/hugo/common/hugo"
)
@ -222,7 +222,7 @@ func (r *ReleaseHandler) replaceInFile(filename string, oldNew ...string) error
}
func git(args ...string) (string, error) {
cmd, _ := hexec.SafeCommand("git", args...)
cmd := exec.Command("git", args...)
out, err := cmd.CombinedOutput()
if err != nil {
return "", fmt.Errorf("git failed: %q: %q (%q)", err, out, args)