diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-15 02:21:59 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-15 02:27:40 +0900 |
| commit | 10a21ce3ef0566194d874b9da9b437971e968133 (patch) | |
| tree | 486d7a93d4abab4c377db632db169e1543c91ae4 /dbus | |
| parent | 0f1f0e43643d302494c0dac8bbc3eda7813f06bb (diff) | |
helper: expose extra files to direct
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'dbus')
| -rw-r--r-- | dbus/run.go | 7 |
1 files changed, 5 insertions, 2 deletions
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 } |
