proc: cleaner extra files
All checks were successful
test / test (push) Successful in 37s

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-12-06 16:05:04 +09:00
parent b3ef53b193
commit cc816a1aaa
4 changed files with 27 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ import (
"sync"
"git.ophivana.moe/security/fortify/helper/bwrap"
"git.ophivana.moe/security/fortify/internal/proc"
)
// BubblewrapName is the file name or path to bubblewrap.
@@ -76,8 +77,7 @@ func (b *bubblewrap) StartNotify(ready chan error) error {
}
if b.sync != nil {
b.Cmd.Args = append(b.Cmd.Args, "--sync-fd", strconv.Itoa(3+len(b.Cmd.ExtraFiles)))
b.Cmd.ExtraFiles = append(b.Cmd.ExtraFiles, b.sync)
b.Cmd.Args = append(b.Cmd.Args, "--sync-fd", strconv.Itoa(int(proc.ExtraFile(b.Cmd, b.sync))))
}
if err := b.Cmd.Start(); err != nil {