From 715addaccdd80052f3817c45b2c13aba0bbb867a Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 18 Jan 2025 12:30:03 +0900 Subject: [PATCH] helper/bwrap: append --sync-fd before -- Signed-off-by: Ophestra --- helper/bwrap.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helper/bwrap.go b/helper/bwrap.go index 7197d42..9c9f37d 100644 --- a/helper/bwrap.go +++ b/helper/bwrap.go @@ -49,6 +49,11 @@ func (b *bubblewrap) StartNotify(ready chan error) error { return errors.New("exec: already started") } + // pass sync fd to bwrap + if b.sync != nil { + b.Cmd.Args = append(b.Cmd.Args, "--sync-fd", strconv.Itoa(int(proc.ExtraFile(b.Cmd, b.sync)))) + } + // prepare bwrap pipe and args if argsFD, _, err := b.control.prepareCmd(b.Cmd); err != nil { return err @@ -76,10 +81,6 @@ func (b *bubblewrap) StartNotify(ready chan error) error { b.Cmd.Env = append(b.Cmd.Env, FortifyHelper+"=1", FortifyStatus+"=-1") } - if b.sync != nil { - 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 { return err }