Audit of 9af1463
This commit is contained in:
+3
-6
@@ -11,8 +11,9 @@ import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"g.fc.run/ai/byre/internal/procgroup"
|
||||
)
|
||||
|
||||
type RepoInfo struct {
|
||||
@@ -435,14 +436,10 @@ func runNetwork(ctx context.Context, dir string, args ...string) (string, string
|
||||
}
|
||||
|
||||
func runCodeInput(ctx context.Context, dir string, env []string, stdin io.Reader, args ...string) (string, string, int, error) {
|
||||
cmd := exec.CommandContext(ctx, "git", args...)
|
||||
cmd := procgroup.CommandContext(ctx, "git", args...)
|
||||
cmd.Dir = dir
|
||||
cmd.Env = append(os.Environ(), env...)
|
||||
cmd.Stdin = stdin
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
cmd.Cancel = func() error {
|
||||
return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
|
||||
}
|
||||
cmd.WaitDelay = 5 * time.Second
|
||||
stderr := &strings.Builder{}
|
||||
cmd.Stderr = stderr
|
||||
|
||||
Reference in New Issue
Block a user