ignoring NEGOTIATE_UNIX_FD

David Zeuthen zeuthen at gmail.com
Mon Nov 5 08:38:18 PST 2012


Hey,

The way this is supposed to work is that *applications* should first
check if the connection in question supports exchanging UNIX file
descriptors. In GDBus, this is done by checking for
G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING on the GDBusConnection
instance [1]. With libdbus or other D-Bus bindings / libraries, I
don't know but it really comes down to whether NEGOTIATE_UNIX_FD
worked or not during authentication.

If the connection does not support exchanging UNIX file descriptors,
simply don't use any API (e.g. methods, signals, properties) that uses
the feature (if you do, the message bus router may kick you off). It's
that simple, really.

If a D-Bus binding or library falls over because D-Bus introspection
data contains data it does not understand, said binding / library
should be fixed to not fall over. Dropping interface members with
types you don't understand (such as 'h') is a good fallback.

I don't think the message bus filtering introspection data or
otherwise trying to be "helpful" is in any way a good idea.

Btw, in the future we may add type 'm' (maybe types) along with
NEGOTIATE_MAYBE_TYPE (and GDBus will then gain another member in its
GDBusCapabilityFlags enum) and exactly the same rules will apply then.

Thanks,
David

[1] : http://developer.gnome.org/gio/unstable/GDBusConnection.html#g-dbus-connection-get-capabilities


More information about the dbus mailing list