diff mbox

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

Message ID 20160927123949.24440-1-bigon@debian.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Laurent Bigonville Sept. 27, 2016, 12:39 p.m. UTC
From: Laurent Bigonville <bigon@bigon.be>

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>
---
 policycoreutils/sandbox/sandbox | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Laurent Bigonville Sept. 27, 2016, 1:49 p.m. UTC | #1
Le 27/09/16 à 15:50, Stephen Smalley a écrit :
> On 09/27/2016 08:39 AM, Laurent Bigonville wrote:
>> From: Laurent Bigonville <bigon@bigon.be>
>>
>> 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>
> Thanks, applied.
Thanks,

Are there any plans to roll a new release of the userspace soon?
Stephen Smalley Sept. 27, 2016, 1:50 p.m. UTC | #2
On 09/27/2016 08:39 AM, Laurent Bigonville wrote:
> From: Laurent Bigonville <bigon@bigon.be>
> 
> 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>

Thanks, applied.

> ---
>  policycoreutils/sandbox/sandbox | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox
> index b6bc805..4010e83 100644
> --- a/policycoreutils/sandbox/sandbox
> +++ b/policycoreutils/sandbox/sandbox
> @@ -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)
>  
>
Stephen Smalley Sept. 27, 2016, 1:58 p.m. UTC | #3
On 09/27/2016 09:49 AM, Laurent Bigonville wrote:
> Le 27/09/16 à 15:50, Stephen Smalley a écrit :
>> On 09/27/2016 08:39 AM, Laurent Bigonville wrote:
>>> From: Laurent Bigonville <bigon@bigon.be>
>>>
>>> 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>
>> Thanks, applied.
> Thanks,
> 
> Are there any plans to roll a new release of the userspace soon?

Yes, 2.6-rc1 is planned on 9/30, and then 2.6 will follow once it seems
stable.
diff mbox

Patch

diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox
index b6bc805..4010e83 100644
--- a/policycoreutils/sandbox/sandbox
+++ b/policycoreutils/sandbox/sandbox
@@ -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)