It seems our D-Bus policies are not being correctly applied, at least not on sysvinit. My test case is connman (because I was fixing the policy): currently the policy has a "allow" policy to let everyone send messages to the service, but I modified /etc/dbus-1/system.d/connman.conf to look like this: <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <policy user="root"> <allow own="net.connman"/> <allow send_destination="net.connman"/> <allow send_interface="net.connman.Agent"/> <allow send_interface="net.connman.Counter"/> <allow send_interface="net.connman.Notification"/> </policy> <policy user="xuser"> <allow send_destination="net.connman"/> </policy> <policy context="default"> <deny send_destination="net.connman"/> </policy> </busconfig> System bus should have a default "deny send_destination", but I left one there anyway: only root and xuser should be allowed to send to net.connman. Then I restarted dbus and connman, created a new user "tester", and as that user ran dbus-send --system --print-reply \ --dest=net.connman \ /net/connman/technology/wifi \ net.connman.Technology.GetProperties And got a real reply from the service. This also happens on fido. I expected to get a D-Bus access violation error, and that is indeed what happened with systemd (although I can't tell how that could affect things). This issue is really only relevant to systems that use non-root users. I have not tested whether the "allow own" policies are applied or not. I'm still thinking I might be doing something wrong here: advice is welcome.
A more useful test command (with actual results on qemu as well): dbus-send --system --print-reply \ --dest=net.connman \ /net/connman/technology/ethernet \ net.connman.Technology.GetProperties
I think it's bluetooth.conf. <policy context="default"> <allow own="org.bluez"/> <allow send_destination="org.bluez"/> <allow send_interface="org.bluez.Agent1"/> <allow send_type="method_call"/> </policy> I think the person writing this thought the allow rules are somehow combined: they are not, so this is ... not optimal: It allows anyone to own org.bluez on system bus and it allows anyone to send messages to anyone on system bus. I'm not sure but I think the reason it happened to work once with systemd is that the order of applying rules seems non-deterministic: sometimes, connmans rule seems to override this one. This feels like dbus-daemon bug (even if the service-specific configuration files aren't supposed to do things like the example here).
Jussi has been digging into this, so reassigning back to him.
commit cdaa8fd9608d1c34a2e6c9f6d0c9dc6ced706859 Author: Jussi Kukkonen <jussi.kukkonen@intel.com> Date: Thu Oct 1 11:04:35 2015 +0300 bluez5: Use upstream D-Bus policy The Bluez D-Bus policy is much too open and affects not just bluez but all system services: Use upstream policy configuration instead. This change has a chance of affecting other D-Bus services: the bug that is fixed here may have hidden problems in other policies. [YOCTO #8414] (From OE-Core rev: 0f6f87c60a6ffeff6b3f53d25f4023749103e262) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Tested by adding a user named ubik and by executing: ubik@qemux86-64:~$ dbus-send --system --print-reply --dest=net.connman /net/connman/technology/ethernet net.connman.Technology.GetProperties Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.13" (uid=1001 pid=934 comm="dbus-send --system --print-reply --dest=net.connma") interface="net.connman.Technology" member="GetProperties" error name="(unset)" requested_reply="0" destination="net.connman" (uid=0 pid=697 comm="/usr/sbin/connmand ") ubik@qemux86-64:~$ exit exit root@qemux86-64:~# dbus-send --system --print-reply --dest=net.connman /net/connman/technology/ethernet net.connman.Technology.GetProperties method return sender=:1.0 -> dest=:1.14 reply_serial=2 array [ dict entry( string "Name" variant string "Wired" ) dict entry( string "Type" variant string "ethernet" ) dict entry( string "Powered" variant boolean true ) dict entry( string "Connected" variant boolean false ) dict entry( string "Tethering" variant boolean false ) ] root@qemux86-64:~# For non-root ubik user, the system errors out a denied access.