[Interest] Qt, running as root (sudo/setuid), DBus and OS X
René J. V. Bertin
rjvbertin at gmail.com
Fri Sep 23 09:26:24 CEST 2016
Thiago Macieira wrote:
>> My first attempts to get a privileged service to work involved exporting my
>> launchd session bus socket to root, via launchctl. That worked; I think
>> that's sufficient proof that root at least can connect to a lesser user's
>> session bus, on OS X.
>
> Probably because dbus-daemon hasn't implemented obtaining the peer's UID on
> macOS. The moment it does, you won't be able to.
With hindsight, I think it never connected. The libdbus initialisation routines
just want to have definitions for all 3 bus address types even if the client is
only going to be connecting to one of them. That must be what happened here:
setting the LAUNCHD_xxxx session bus env. variable provided the only bit of
required but ultimately unused information the absence of which stood in the way
of successful initialisation.
R.
More information about the Interest
mailing list