User bus conclusion

Lennart Poettering mzqohf at 0pointer.de
Wed Nov 10 05:42:55 PST 2010


On Wed, 10.11.10 09:05, Thiago Macieira (thiago at kde.org) wrote:

> On Wednesday, 10 de November de 2010 02:49:29 Lennart Poettering wrote:
> > On Tue, 09.11.10 20:17, Mike Gorse (mgorse at novell.com) wrote:
> > > How would applications that su to root tie into this?  If a user
> > > becomes root, would the existing user bus continue to be used?
> > 
> > Yes, I think this would be the most useful behaviour and would also
> > match how the kernel handles sessions with the audit session id.
> 
> That makes sense to me too, but how would this work in your proposal?
> 
> Since the user has changed, it's no longer the same user's user bus.

Well, this is how it works in the glorious systemd future:

When you initially login, you will get this:

- An audit session login is created for your user
- The audit loginuid will be set for your initial process, and be
  inherited by everything you spawn, even if you change privs with
  su/sudo a couple of times.
- A cgroup is created for your user, which will contain all your
  processes, including everything inside a su/sudo
- An XDG_RUNTIME_DIR is created for your user
- A systemd instance is created for your user
- A D-Bus instance is created for your user (or at least made socket-activatable)

When you eventually completely log out:

- All your processes are killed (i.e. everything in the cgroup,
  including dbus, including systemd)
- Your XDG_RUNTIME_DIR will be removed.
- Your audit session will die a silent death

In between every process with your loginuid will use the same
XDG_RUNTIME_DIR and rely on the same systemd and the same bus.

Or in other words: there's going to be a 1:1 mapping between the user
bus and a specific /proc/self/loginuid value, not between the user bus
and a specific getuid() value.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the dbus mailing list