Unix FD Passing

Lennart Poettering mzqohf at 0pointer.de
Wed May 20 13:09:36 PDT 2009


On Sat, 16.05.09 00:54, Lennart Poettering (mzqohf at 0pointer.de) wrote:

> 
> On Sat, 25.04.09 23:41, Havoc Pennington (havoc.pennington at gmail.com) wrote:
> 
> > @@ -2047,7 +2166,7 @@ dbus_message_iter_get_fixed_array (DBusMessageIter  *iter,
> >    _dbus_return_if_fail (_dbus_message_iter_check (real));
> >    _dbus_return_if_fail (value != NULL);
> >    _dbus_return_if_fail ((subtype == DBUS_TYPE_INVALID) ||
> > -                         dbus_type_is_fixed (subtype));
> > +                        (dbus_type_is_fixed (subtype) && subtype !=
> > DBUS_TYPE_UNIX_FD));
> >
> > This means that a binding or app can't check dbus_type_is_fixed() to
> > see if get_fixed_array/append_fixed_array will work. The simplest fix
> > is probably to just go ahead and support an array of fd.
> 
> Brr. That was a beast. Arrays of fds are now supported.

I removed that patch of mine again. It sucked.

I don't really think this would help much anyway. Because unix fd
arrays would have to be handled by clients more like string arrays
than the other fixed arrays, since I'd need to allocate memory for
them because I need to translate the array of indexes stored in the
message to the actual array of file descriptors. Which means file
descriptors *need* to be handled different from the other fixed types
anyway. (because the array returned would need to be freed)

But uh, in the end I am just a lazy guy who noticed that unmarshalling
those unix fds arrays isn't much fun ;-)

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the dbus mailing list