Best option to send file descriptors over dbus?

Havoc Pennington hp at
Sun Oct 31 21:57:47 PST 2004

On Mon, 2004-11-01 at 04:28 +0100, Carlos Perello Marin wrote:
> Hi, I'm working on a client/server implementation using D-BUS as the IPC
> and I need a way to send file descriptors over D-BUS.

What is the specific application?

> This feature is supported with unix sockets so I suppose it's a matter
> of implement an API around it so D-BUS can handle it without major
> problems.

This would break though e.g. if an app connects to the bus over TCP,
which we'd expect to have when running an X app remotely for example.

> My first thoughts about it is to add a new type to DBusMessage that
> stores a file descriptor and then, inside the unix transport send it as
> cmsg man page (cmsg(3)) specifies, the transports that cannot work with
> that kind of data could just ignore that part of the message.

Will it work to pass the fd from one app to the bus and then to another

It sounds really complicated... it probably makes the way messages are
buffered and parsed a lot trickier as well.

> With this mail I just want to know if a patch done as I'm suggesting
> will be accepted into D-BUS so I don't waste my time. If you don't agree
> with it, any suggestion to get this functionality is welcomed.

I think the patch would be hard to write, and pose a number of issues (I
can't predict all of them in advance).


More information about the dbus mailing list