# DBus and at_console policy, trying to get bluez working

## GreyVicious

Hi, I'm using sys-apps/dbus-1.2.3-r1 and net-wireless/bluez-4.28. when I try to send something to bluez from user I get:

```
./simple-agent hci0 XX:XX:XX:XX:XX:XX

ERROR:dbus.proxies:Introspect error on :1.9:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents thissender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.9")

Traceback (most recent call last):

  File "./simple-agent", line 84, in <module>

    path = manager.FindAdapter(sys.argv[1])

  File "//usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in __call__

    return self._proxy_method(*args, **keywords)

  File "//usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__

    **keywords)

  File "//usr/lib/python2.5/site-packages/dbus/connection.py", line 622, in call_blocking

    message, timeout)

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.bluez.Manager" member "FindAdapter" error name "(unset)" destination ":1.9")
```

I also added /etc/dbus-1/bluez.conf :

```
<!-- This configuration file specifies the required security policies

     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"

 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">

    <allow own="org.bluez"/>

    <allow send_destination="org.bluez"/>

    <allow send_interface="org.bluez.Agent"/>

  </policy>

  <policy at_console="true">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy context="default">

    <deny send_destination="org.bluez"/>

  </policy>

</busconfig>

```

But still got nothing.... The problem is that at_console policy is not supported by Gentoo's dbus.

Is there a chance to make it working on Gentoo?

----------

## keyson

Hi GreyVicious,

Think this should go under 'unsupported software'.

But to your problem. This is due to that it is tested on fedora and they have a pam module called pam_console.

You can change the line to user="youruser" because the bluez, dbus and other packages is not up to date,

and don't expect it to run with the old script as the api has changed.

B.t.w. so is the test-programs not installed right by the ebuild.

ref:http://www.redhat.com/magazine/003jan05/features/dbus/

regards

Kjell

EDIT: consolekit should fix this. https://bugs.gentoo.org/show_bug.cgi?id=219558

----------

