From 10a21ce3ef0566194d874b9da9b437971e968133 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 15 Mar 2025 02:21:59 +0900 Subject: helper: expose extra files to direct Signed-off-by: Ophestra --- dbus/run.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dbus') diff --git a/dbus/run.go b/dbus/run.go index e1f54fb9..30b06f4e 100644 --- a/dbus/run.go +++ b/dbus/run.go @@ -10,6 +10,7 @@ import ( "path/filepath" "strconv" "strings" + "syscall" "git.gensokyo.uk/security/fortify/helper" "git.gensokyo.uk/security/fortify/helper/bwrap" @@ -40,13 +41,14 @@ func (p *Proxy) Start(ctx context.Context, output io.Writer, sandbox bool) error c, cancel := context.WithCancelCause(ctx) if !sandbox { h = helper.NewDirect(c, p.name, p.seal, true, argF, func(cmd *exec.Cmd) { + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} if output != nil { cmd.Stdout, cmd.Stderr = output, output } // xdg-dbus-proxy does not need to inherit the environment cmd.Env = make([]string, 0) - }) + }, nil) } else { // look up absolute path if name is just a file name toolPath := p.name @@ -117,10 +119,11 @@ func (p *Proxy) Start(ctx context.Context, output io.Writer, sandbox bool) error } h = helper.MustNewBwrap(c, toolPath, p.seal, true, argF, func(cmd *exec.Cmd) { + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} if output != nil { cmd.Stdout, cmd.Stderr = output, output } - }, bc, true, nil, nil) + }, nil, bc, nil) p.bwrap = bc } -- cgit v1.3.1