Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to dbus user bus as root #6249

Closed
nico-meetprizm opened this issue Jun 30, 2017 · 3 comments
Closed

Connect to dbus user bus as root #6249

nico-meetprizm opened this issue Jun 30, 2017 · 3 comments

Comments

@nico-meetprizm
Copy link

Submission type

  • Bug report

systemd version the issue has been seen with

v231 (systemd-231-15.fc25.x86_64)

Used distribution

Fedora release 25 (Twenty Five)

Steps to reproduce the problem

sudo env DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus busctl --user list

Expected behaviour you didn't see

Unless I misunderstood something, we should be able to connect to a user dbus bus as root as long as we have the proper environment set.

It should be able to connect to user dbus session and print well known names

Unexpected behaviour you saw

Failed to list names: Connection reset by peer

@poettering
Copy link
Member

dbus-daemon is the component enforcing access there, and it does not consider "root" as a user that has god-like privs by default (but you can drop an xml policy file in, to make it so).

Anyway, closing this here, as the policy is enforced by something outside of systemd (i.e. dbus-daemon), please ping the dbus folks about this.

@Bluehorn
Copy link

For reference, I managed to give root access to all session buses by putting this

<busconfig>
  <policy context="mandatory">
    <allow user="root"/>
  </policy>
</busconfig>

into the file /etc/dbus-1/session-local.conf. I tried using <policy user="root"> but did not find any allow rules that would allow root to connect. Alternatively, I used <policy context="default">, but this seem to override the global config so I had to repeat the allow rules from /usr/share/dbus-1/session.conf.

Maybe this will help somebody some day.

@ShellCode33
Copy link

You sir made my night. Took me hours to figure out.

For SEO: I had a similar issue under Wayland when trying to send notifications from root to my user. The error I had was The connection is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants