sandbox: resolve tty name
Some checks failed
Test / Create distribution (push) Successful in 26s
Test / Fpkg (push) Failing after 53s
Test / Fortify (push) Failing after 1m19s
Test / Data race detector (push) Failing after 1m53s
Test / Flake checks (push) Has been skipped

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-03-24 15:28:25 +09:00
parent b989a4601a
commit 94ddc768c3
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 6 additions and 5 deletions

View File

@ -239,7 +239,6 @@ func Init(prepare func(prefix string), setVerbose func(verbose bool)) {
cmd := exec.Command(params.Path)
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.Args = params.Args
cmd.Env = params.Env
cmd.ExtraFiles = extraFiles

View File

@ -156,7 +156,7 @@ func (d MountDev) apply(params *Params) error {
if err := hostProc.bindMount(
toHost("/dev/"+name),
targetPath,
syscall.MS_RDONLY,
0,
true,
); err != nil {
return err
@ -204,10 +204,12 @@ func (d MountDev) apply(params *Params) error {
if err := ensureFile(consolePath, 0444, 0755); err != nil {
return err
}
if err := hostProc.bindMount(
hostProc.stdout(),
if name, err := os.Readlink(hostProc.stdout()); err != nil {
return msg.WrapErr(err, err.Error())
} else if err = hostProc.bindMount(
toHost(name),
consolePath,
syscall.MS_RDONLY,
0,
false,
); err != nil {
return err