aboutsummaryrefslogtreecommitdiffhomepage
path: root/dbus/run.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-07 12:48:20 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-07 12:48:20 +0900
commit9647eb6a6b5607e9aac1e2c113e80f2e966ec0ac (patch)
tree2f314f8669742a817df0057ceab79891b36bea9d /dbus/run.go
parent18d9ce733e19c500ca04b4e744e6cdc5c6faf137 (diff)
helper: separate pipes from Helper
Upcoming bwrap helper implementation requires two sets of pipes to be managed, fd will also no longer be constant. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'dbus/run.go')
-rw-r--r--dbus/run.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/dbus/run.go b/dbus/run.go
index 0b8267f8..da0bbc8d 100644
--- a/dbus/run.go
+++ b/dbus/run.go
@@ -3,6 +3,7 @@ package dbus
import (
"errors"
"io"
+ "strconv"
"git.ophivana.moe/cat/fortify/helper"
)
@@ -18,9 +19,13 @@ func (p *Proxy) Start(ready chan error, output io.Writer) error {
}
h := helper.New(p.seal, p.path,
- // Helper: Args is always 3 and status if set is always 4.
- "--args=3",
- "--fd=4",
+ func(argsFD, statFD int) []string {
+ if statFD == -1 {
+ return []string{"--args=" + strconv.Itoa(argsFD)}
+ } else {
+ return []string{"--args=" + strconv.Itoa(argsFD), "--fd=" + strconv.Itoa(statFD)}
+ }
+ },
)
// xdg-dbus-proxy does not need to inherit the environment
h.Env = []string{}