sandbox: resolve tty name
All checks were successful
Test / Create distribution (push) Successful in 19s
Test / Fortify (push) Successful in 2m17s
Test / Fpkg (push) Successful in 3m15s
Test / Data race detector (push) Successful in 4m10s
Test / Flake checks (push) Successful in 56s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-24 15:28:25 +09:00
parent b989a4601a
commit ad3576c164
3 changed files with 12 additions and 11 deletions

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