simple UNIX_FD pass test?

David Sommerseth dbus at
Thu Nov 15 17:23:29 UTC 2018

On 12/11/2018 16:18, Felipe Gasper wrote:
> Hello,
> 	I’m working on support for unix FD passing in Protocol::DBus.
> 	What would be a simple way to test my implementation? Is there maybe a built-in (or systemd) method call that always returns unix FDs or some such?
> 	Thank you!

I've used the unit test code available in glib2, both to better understand and
to test passing of FDs.

Client/caller side implementation:

Server/service side implementation:

In my project (openvpn3-linux) we're using glib2 for the D-Bus implementation,
so for us these implementations was fairly straight forward to adopt; even
though we're using slightly different and more high-level functions [IIRC: 0,
1].  But our own unit tests works well against the glib2 unit tests, so we
believe we managed to nail it :)  (We're just in the middle of cleaning up our
code using this feature, so it isn't public just yet - but most likely next
week or so)


kind regards,

David Sommerseth
OpenVPN Inc

More information about the dbus mailing list