Who called my DBus API on Linux

The scenario is as follows:

On a Linux-based handheld device, I have a C application that has dbus APIs ready to be called by third-party applications. The DBus API is called at boot time.

Is there any system API that I can use in my functions to print the caller ID and save it to syslog?

Thanks in advance!

+4
source share
1 answer

/org/freedesktop/DBus object on the bus org.freedesktop.DBus has two methods that belong to the org.freedesktop.DBus interface (oh, well): GetConnectionUnixUser and GetConnectionUnixProcessID . Both accept a unique name for row- dbus_message_get_sender connection, which can be obtained by calling dbus_message_get_sender (or any other method that your high-level API cover offers).

+2
source

All Articles