Re: about using privileged (KAuth) helpers: system dbus daemon on OS X?

René J.V. Bertin <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <5602144.BeALKnFIT6@bola>
On Sunday September 18 2016 19:11:56 Thiago Macieira wrote:

>> 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

OK, then what should a service executable do to connect to the system bus? Clearly this is done correctly for Linux and there's no platform-specific code in the code (KAuth framework) I'm working on, so we're back in dbus land.

On OS X, the service exec connects to the bus socket pointed to by a single env. variable (DBUS_LAUNCHD_SESSION_BUS_SOCKET) that's obtained in a dedicated function. I can hijack that variable to point to the system bus socket but it would of course be nicer to complete that function with a mechanism to check for and read DBUS_LAUNCHD_SYSTEM_BUS_SOCKET.

FWIW: googling DBUS_LAUNCHD_SYSTEM_BUS_SOCKET returns a single hit: https://github.com/tonyrog/dbus/blob/master/src/dbus_connection.erl
Apparently someone already encountered the need for connecting to a system bus on OS X in erlang code.

R.
_______________________________________________
dbus mailing list
[email protected]
https://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.