2018-05-30 22:26:09

by Rafał Bilski

[permalink] [raw]
Subject: [PATCH] Allow bluetoothd to call methods on dbus' system bus

Default dbus configuration doesn't allow calling methods on system bus. Only sending signals is
allowed.
If "mpris-proxy" isn't running "/usr/lib/gsd-media-keys" translates keystrokes from
"profiles/audio/avctp.c:handle_panel_passthrough()"
to dbus method calls on session bus. This is allowed on dbus by default.
If "mpris-proxy" is running "bluetoothd" executes dbus' method calls on system bus.  These
apparently are rejected by default.

diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 0c0b221bb..1cafab631 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -8,6 +8,7 @@
<!-- ../system.conf have denied everything, so we just punch some holes -->

<policy user="root">
+ <allow send_type="method_call"/>
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>



2018-05-31 17:02:02

by Rafał Bilski

[permalink] [raw]
Subject: Re: [PATCH] Allow bluetoothd to call methods on dbus' system bus


> Hi Rafal,
>
> On Thu, May 31, 2018 at 1:26 AM, Rafał Bilski <[email protected]> wrote:
>> Default dbus configuration doesn't allow calling methods on system bus. Only
>> sending signals is allowed.
>> If "mpris-proxy" isn't running "/usr/lib/gsd-media-keys" translates
>> keystrokes from "profiles/audio/avctp.c:handle_panel_passthrough()"
>> to dbus method calls on session bus. This is allowed on dbus by default.
>> If "mpris-proxy" is running "bluetoothd" executes dbus' method calls on
>> system bus. These apparently are rejected by default.
>>
>> diff --git a/src/bluetooth.conf b/src/bluetooth.conf
>> index 0c0b221bb..1cafab631 100644
>> --- a/src/bluetooth.conf
>> +++ b/src/bluetooth.conf
>> @@ -8,6 +8,7 @@
>> <!-- ../system.conf have denied everything, so we just punch some holes
>> -->
>> <policy user="root">
>> + <allow send_type="method_call"/>
>> <allow own="org.bluez"/>
>> <allow send_destination="org.bluez"/>
>> <allow send_interface="org.bluez.Agent1"/>
>>
> I think the correct fix would be to add the interface
> (org.mpris.MediaPlayer2.Player) we are using to communicate with the
> player.
>
Hi,

You're right. Your approach works fine.


Thank you

Rafal Bilski



2018-05-31 12:15:52

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] Allow bluetoothd to call methods on dbus' system bus

Hi Rafal,

On Thu, May 31, 2018 at 1:26 AM, Rafa=C5=82 Bilski <[email protected]>=
wrote:
> Default dbus configuration doesn't allow calling methods on system bus. O=
nly
> sending signals is allowed.
> If "mpris-proxy" isn't running "/usr/lib/gsd-media-keys" translates
> keystrokes from "profiles/audio/avctp.c:handle_panel_passthrough()"
> to dbus method calls on session bus. This is allowed on dbus by default.
> If "mpris-proxy" is running "bluetoothd" executes dbus' method calls on
> system bus. These apparently are rejected by default.
>
> diff --git a/src/bluetooth.conf b/src/bluetooth.conf
> index 0c0b221bb..1cafab631 100644
> --- a/src/bluetooth.conf
> +++ b/src/bluetooth.conf
> @@ -8,6 +8,7 @@
> <!-- ../system.conf have denied everything, so we just punch some hole=
s
> -->
> <policy user=3D"root">
> + <allow send_type=3D"method_call"/>
> <allow own=3D"org.bluez"/>
> <allow send_destination=3D"org.bluez"/>
> <allow send_interface=3D"org.bluez.Agent1"/>
>

I think the correct fix would be to add the interface
(org.mpris.MediaPlayer2.Player) we are using to communicate with the
player.

--=20
Luiz Augusto von Dentz