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

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

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
This commit is contained in:
Laurent Bigonville 2016-09-27 14:39:49 +02:00 committed by Stephen Smalley
parent ff0d3dde2e
commit a992b9993d

View File

@ -285,9 +285,13 @@ 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))
""" % (command, wm, command, command))
fd.close()
os.chmod(execfile, 0o700)