Re: about using privileged (KAuth) helpers: system dbus daemon on OS X?
Thiago Macieira <[email protected]>
| Newsgroups | gmane.comp.freedesktop.dbus |
|---|---|
| Message-ID | <64209827.brDD4j5zOj@tjmaciei-mobl1> |
On segunda-feira, 19 de setembro de 2016 02:30:22 PDT René J.V. Bertin wrote: > On Sunday September 18 2016 16:57:48 Thiago Macieira wrote: > > I have no idea what other kind of helper there may be. There's only "dbus- > > daemon-launch-helper", which is setuid root, but setuids to the service's > > user. The launched service only sees its own UID, never 0. > > There's too much room for confusion here: dbus-daemon-launch-helper the > helper for DBus, and the process that implements the service which is (or > can act as) a helper for the actual operation that is to be done. Understood. But so we're all on the same page this is the dbus mailing list and only dbus-daemon's helpers are helpers. The helper launches the service's executable. > > > So we have a user application (say, ksysguard) that calls DBus routines > > > to > > > launch a privileged helper process (ksysguardprocesslist_helper), a > > > master > > > > That's not how it works. An application asks for a service, like > > org.bluez. If there's a .service file that matches that, it specifies the > > executable name along with the user ID to run under. Then dbus-daemon > > runs dbus-daemon-launch- helper and that will setuid, clean the > > environment, then exec the target executable. > > Not to contradict you, but that looks almost exactly like what I tried to > describe in different words... Ok. > > No, that's the UID for dbus-daemon running as the system bus. The helper > > runs as root, then setuid()s, as described above. > > From what I've seen the helper binary must be owned root and have the setuid > bit set, so that when it launches it has uid=messagebus and euid=root. Correct. -rwsr-x--- 1 root messagebus 56856 set 17 08:56 /lib/dbus-1/dbus-daemon- launch-helper > > > If the privileged helper (slave) is supposed to connect to the system > > > dbus > > > when launched via dbus-daemon-helper-tool, how/why does it do so on > > > Linux? > > > > The helper does not connect to the any bus. The executable that it > > launches is expected to connect ot the system bus, as described above. > > Again, that's the helper I meant, not the dbus helper. Ok, so the application connects to the system bus. it does not connect to any session bus. > Is it roughly correct to say that on Linux an application will try to > connect on the system bus if it doesn't find a session bus address? No. Applications connect to the bus they were designed to connect to. If they can't, they exit with error. $ DBUS_SESSION_BUS_ADDRESS= DISPLAY= qdbus Could not connect to D-Bus server: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel Open Source Technology Center _______________________________________________ dbus mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dbus