From e285f33ecbc798069e1ea612655ce0e9eb6ac55f Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 22 Jul 2026 23:18:07 -0700 Subject: [PATCH] fix(executor/sandbox): non nil stdin --- internal/executor/sandbox/executor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/executor/sandbox/executor.go b/internal/executor/sandbox/executor.go index 39f2461..d8d3e4f 100644 --- a/internal/executor/sandbox/executor.go +++ b/internal/executor/sandbox/executor.go @@ -103,6 +103,9 @@ func (e *Sandbox) runWithTar(cmds []stage.Cmd, tarData []byte) ([]stage.Executor tarCmd := stage.Cmd{ Args: []string{"/bin/tar", "xf", tarFileName, "-C", "/w"}, Env: cmds[0].Env, + Stdin: &stage.CmdFile{Content: strPtr("")}, + Stdout: &stage.CmdFile{Name: strPtr("__tar_stdout"), Max: int64Ptr(1)}, + Stderr: &stage.CmdFile{Name: strPtr("__tar_stderr"), Max: int64Ptr(1)}, CPULimit: cmds[0].CPULimit, ClockLimit: cmds[0].ClockLimit, MemoryLimit: cmds[0].MemoryLimit, @@ -326,3 +329,7 @@ func (e *Sandbox) Cleanup() error { } return nil } + +func strPtr(s string) *string { return &s } + +func int64Ptr(i int64) *int64 { return &i }