Fwd: connect to session bus from root app

Sergei Lopatin <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <CAOOXVOivkEiE__MCLyOdskf7BDhN7vbch6sMv6-6K-zfpr2=ew@mail.gmail.com>
Hi all!

I try to connect to user session bus from my Qt root app. Unfortunately, I
can't do this right.

First, I share DBUS_SESSION_BUS_ADDRESS variable with my app.
Second, I use setuid(1000) in my app to set user ID.
And all works fine! But.. I can't get root rights back when setuid is used.
But if I use seteuid instead of setuid, session bus is unavailable.

So, my question is why seteuid is not enough to get access to user session
bus? Maybe I do something wrong?

FYI: I need root privileges to access system devices directly and session
bus to set inhibitions preventing sleep/idle.

-- 
Best regards, Sergei Lopatin
e-mail: [email protected]

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.