Skip to contentSkip to conversation

sandbox: Use dbus-run-session instead of dbus-launch when available

PATCH Superseded Laurent Bigonville 1 participant 1 message Sep 27, 2016 SELinux security module

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sandbox: Use dbus-run-session instead of dbus-launch when available

From: Laurent Bigonville <[email protected]>

According to dbus upstream: "dbus-launch is fairly horrible code, complicated by the historical need for it to support X11 autolaunching, so the D-Bus maintainers would like to move it out of the critical path and minimize its use."

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836289

---
 policycoreutils/sandbox/sandbox | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
policycoreutils/sandbox/sandbox +5 -1
index b6bc805..bfb2de3 100644
@@ -285,7 +285,11 @@ class Sandbox:
 # /usr/bin/test -r ~/.xmodmap && /usr/bin/xmodmap ~/.xmodmap
 %s &
 WM_PID=$!
-dbus-launch --exit-with-session %s
+if which dbus-run-session >/dev/null 2>&1; then
+    dbus-run-session -- %s
+else
+    dbus-launch --exit-with-session %s
+fi
 kill -TERM $WM_PID  2> /dev/null
 """ % (command, wm, command))
         fd.close()
Signature · 1 line
2.9.3