[systemd-devel] Best way to ensure only registered clients can use certain methods.

Mantas Mikulėnas grawity at gmail.com
Mon May 30 08:24:52 UTC 2016


On Mon, May 30, 2016 at 3:41 AM, Christian Lockley <clockley1 at gmail.com>
wrote:

> Hi all,
>  I developing an app that returns an id after and init function, this id
> is to be passed the subsequent calls so the program can prevent clients
> from modifying the internal state of other clients. Right now I store the
> value returned by sd_bus_message_get_sender() in the init function then
> call sd_bus_message_get_sender() again in all the other functions,
> verifying the value matches what I expect. Is this the correct or best way
> to do this?
>

IIRC, get_sender() returns the connection's unique D-Bus name, so yeah, it
would be safe to use.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160530/9f15970a/attachment-0001.html>


More information about the systemd-devel mailing list