Skip to content

Commit 8b0b51e

Browse files
blink-so[bot]f0ssel
andcommitted
Fix unprivileged mode command execution
- Apply environment variables to command - Set stdin/stdout/stderr for proper I/O - Add missing os import Co-authored-by: f0ssel <[email protected]>
1 parent 75d6723 commit 8b0b51e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

namespace/unprivileged.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package namespace
33
import (
44
"fmt"
55
"log/slog"
6+
"os"
67
"os/exec"
78
)
89

@@ -39,6 +40,10 @@ func (u *Unprivileged) Start() error {
3940

4041
func (u *Unprivileged) Command(command []string) *exec.Cmd {
4142
cmd := exec.Command(command[0], command[1:]...)
43+
cmd.Env = u.commandEnv
44+
cmd.Stdout = os.Stdout
45+
cmd.Stderr = os.Stderr
46+
cmd.Stdin = os.Stdin
4247
return cmd
4348
}
4449

0 commit comments

Comments
 (0)