Bug 66114

Summary: change spec so unknown match rule keys are ignored
Product: dbus Reporter: Chengwei Yang <chengwei.yang.cn>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: enhancement    
Priority: low CC: chengwei.yang.cn, msniko14
Version: 1.5Keywords: patch
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH] DBus Specification: unknown key in match rule must be ignored
[PATCH v2] DBus Specification: unknown key in match rule must be ignored

Description Chengwei Yang 2013-06-24 08:48:52 UTC
unknown key in match rule just like unknown field in message header, to avoid compatibility issue if new key/field introduced in future, the dbus specification says "Again, if an implementation sees a header field code that it does not expect, it must ignore that field, as it will be part of a new (but compatible) version of this specification."

I think this is applicable to unknown key in match rule situation.
Comment 1 Chengwei Yang 2013-06-24 09:00:32 UTC
Created attachment 81311 [details] [review]
[PATCH] DBus Specification: unknown key in match rule must be  ignored
Comment 2 Chengwei Yang 2013-06-24 09:29:19 UTC
Created attachment 81313 [details] [review]
[PATCH v2] DBus Specification: unknown key in match rule must be  ignored
Comment 3 Simon McVittie 2013-06-24 11:43:03 UTC
As I said on the mailing list, match rule keys are not header field codes.

This is a feature request: "change the D-Bus Specification so that unknown match rule keys are ignored". It would make all known versions of dbus-daemon instantly non-compliant with that specification.
Comment 4 Chengwei Yang 2013-06-24 13:15:03 UTC
(In reply to comment #3)
> As I said on the mailing list, match rule keys are not header field codes.

Yes, I known that, just want to say this is just like the message header situation, sorry for my english skill.

> 
> This is a feature request: "change the D-Bus Specification so that unknown
> match rule keys are ignored". It would make all known versions of
> dbus-daemon instantly non-compliant with that specification.

I'm so happy to see that you agree with me.
Comment 5 Chengwei Yang 2013-06-24 14:15:30 UTC
>On 24/06/13 08:26, Yang Chengwei wrote:
>> Hi List,
>
>No need to Cc me - oddly enough, the person who has done most of the
>D-Bus releases in the last 2 years does read the mailing list :-)
>
>> I just found that the *new* dbus-monitor can't run with the *old" 
>> dbus-daemon.
>
>"Old" here means 1.4, which is older than the current stable branch. I

Yes, that is 1.4.18 on ubuntu.

>don't support older-than-current-stable D-Bus versions, except for
>non-intrusive security fixes.
>
>> Error: Unknown key "eavesdrop" in match rule
>> 
>> This is cause by "eavesdrop" is newly added to dbus to fix an
>> issue: https://bugs.freedesktop.org/show_bug.cgi?id=37890
>
>The right way to fix this would be to do the AddMatch with eavesdrop,
>and if it fails, try again without it - like Bustle does[1]. I'd
>accept a patch that did this, if you think compatibility with D-Bus
>1.4 is really that important.
>
>[1] http://cgit.freedesktop.org/bustle/tree/c-sources/pcap-monitor.c
>

Sure, will do so for dbus-monitor.

>> Again, if an implementation sees a header field code that it does
>> not expect, it must ignore that field, as it will be part of a new
>> (but compatible) version of this specification.
>
>This is specifically talking about header fields: if it was meant to
>be about other constructs, it would say so.
>
>> So I think it's applicable to the match rule, say: ignore unknown
>> keys in match rule.
>
>If you think the D-Bus Specification should have similar wording about
>match rules too, that's a reasonable request to consider.

Yes, that's what I did mean.

>
>In general, adding keys to a match rule makes it narrower, so in
>general, adding an unrecognised key would result in the client
>receiving more messages than it had intended to. In principle, clients
>should consider match rules to be advisory, not mandatory, so in
>principle, it should be prepared to ignore those extra messages. In
>practice, there have been clients that are buggy if they receive
>unwanted messages.
>
>So, it's a question of which of these is more valuable:
>
>* making it fractionally easier to add more match rule keys (clients
>  wouldn't have to "guard" their AddMatch calls, if they can depend on
>  a D-Bus version new enough that it ignores unknown keys)
>
>* minimizing how much we break the expectations of clients that wrongly
>  expect their match rules to be exclusive

Yes, as you said, it's *wrongly*.

>
>If we make this change to the specification, it won't change the
>behaviour of currently-deployed copies of D-Bus, so clients using new
>match rules will *still* have to "guard" AddMatch calls until they can
>depend on a new enough D-Bus version that it has the "ignore unknown
>match rules" behaviour. I think that's the sort of behavioural change
>that should go through a development branch (1.7), meaning it won't be
>widespread until 1.8.

That's fine for me.

As you said in comment 3, we'll adopt this change, although this change will make all distributed dbus-daemon not compliant with the new specification.

>
>    S
Comment 6 Simon McVittie 2013-06-24 14:20:27 UTC
(In reply to comment #5)
> As you said in comment 3, we'll adopt this change

I didn't say that, I said this was a feature request. There are two possible resolutions for a feature request: "yes, add it" and "no, we don't want that".
Comment 7 Simon McVittie 2013-06-24 14:22:23 UTC
I'm not going to make this change until/unless people have had a chance to respond on the mailing list. I don't have any particular objection to it, but the other maintainers might.
Comment 8 Chengwei Yang 2013-06-26 05:13:29 UTC
Several patches for dbus-monitor uploaded at #bug66107, includes the one keep backwards compatibility with old dbus which hasn't eavesdropping as a match rule key.
Comment 9 GitLab Migration User 2018-10-12 21:16:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/84.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.