Could I connect user's session bus from root?

Thiago Macieira thiago at kde.org
Wed May 12 09:26:45 PDT 2010


Em Quarta-feira 12 Maio 2010, às 18:02:10, Rémi Denis-Courmont escreveu:
> Le mercredi 12 mai 2010 14:04:40 Thiago Macieira, vous avez écrit :
> > Em Quarta-feira 12. Maio 2010, às 12.13.06, danny escreveu:
> > > Dear All,
> > > 
> > > I have a program run as root, but I need get information from GVFS
> > > which is on the session bus, and it shows "failed to connect the
> > > session bus" while I run the test program, and it could not get any
> > > information from the GVFS.
> > > 
> > > Could I access the session bus in my "root" program?
> > 
> > No.
> > 
> > The user's session bus requires the user's UID. Your program needs to
> > drop privileges before connecting.
> 
> I think, in principles, the root process could just set its effective UID
> to the user, while establishing the DBus connection, then back to root. It
> does not need to drop the root privileges.

Well, setting the EUID is dropping the privileges, even if you can still take 
them back later :-)

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100512/b61e0bde/attachment.pgp>


More information about the dbus mailing list