Clarification on some bus behaviour

Will Thompson will.thompson at collabora.co.uk
Wed Sep 8 04:12:58 PDT 2010


On 08/09/10 10:56, Thiago Macieira wrote:
> 1) Is the application allowed to assume that the bus will send all messages
> that have this connection as a destination, without having to add a match rule
> for it? In other words, can I drop that first add_match above?
>
> I would think that the answer here is Yes. This rule should be implicit.

I agree. I think it already is implicit from 
<http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus>, 
but maybe only from the Ping example given there. I've attached a patch 
making it explicit.

> 2) Is the application allowed to assume that the bus will always send the
> NameAcquired and NameLost signals without having to add a match rule for it?
> In other words, can I drop the second and fourth add_match calls above?
>
> I would think that the answer here is also Yes.

I agree.

> 3) Is the application allowed to assume anything about the owner of the
> org.freedesktop.DBus name?
>
> I think the answer here is No.
>
> The reference dbus-daemon has the owner of org.freedesktop.DBus as also
> org.freedesktop.DBus, even though that's not a unique connection name. I could
> think of a different implementation using something like :0 or :1.0 as the
> unique name.
>
> Therefore, I'd say that a binding must not assume anything about the actual
> owner of the bus service. That GetNameOwner call of mine must still be there.
>
> However, it should be ok to assume that the name never changes owners, so the
> third add_match of mine can be skipped.

I'm probably missing something, but I don't really see why you need to 
know who owns that bus name, if it's never going to change.

I guess you need to verify that incoming messages from the daemon really 
are from the daemon; but if so, I think it would be better for everyone 
if we mandated the reference implementation's behaviour.

Regards,
-- 
Will


More information about the dbus mailing list