How to get DBus sender's information in the code

Mike Gorse mgorse at novell.com
Wed May 4 09:06:03 PDT 2011


Hi Tao,

I'm not sure if I'm understanding your question correctly, but, when your 
app receives a message, you can call dbus_message_get_sender to get the 
caller's D-Bus id, and, assuming you are using dbus-daemon to route the 
messages, you can call GetConnectionUnixProcessID to get the pid of the 
process that sent the message.  It is described in the D-Bus specification 
(http://dbus.freedesktop.org/doc/dbus-specification.html).

Hth,
-Mike G-

On Wed, 4 May 2011, tao wu wrote:

> Hi,
>
> The scenario is like this:
>
> In a Linux based handheld device I have a C app which has dbus APIs
> ready to be called by 3rd party apps. The DBus APIs are called during
> booting time.
>
> Is there any system API I can use to in my functions to print the
> caller's ID and save it to syslog?
>
> Thanks in advance!
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>


More information about the dbus mailing list