diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-07-16 14:35:15 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:06:20 +0100 |
commit | 628a60d53c9d0795d94bdca532dc47771c33bff8 (patch) | |
tree | 2955caa4606001219f51c183d39fc972e0f8207d /src | |
parent | c075af2785a99062537699a87b5f83dd666144b7 (diff) |
sd-bus: destination-matches cannot match NameOwnerChanged
Make sure we don't install NameOwnerChanged matches if the caller passed
a destination='' match (except if it is the broadcast address). Per spec,
all NameOwnerChanged signals are broadcasts.
Only the NameLost/NameAcquired signals are unicasts, but those are never
received through sd-bus. Instead, the bus-proxy synthesizes them and it
already installs proper matches for them.
Diffstat (limited to 'src')
-rw-r--r-- | src/libelogind/sd-bus/bus-control.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libelogind/sd-bus/bus-control.c b/src/libelogind/sd-bus/bus-control.c index a38c5c50f..526e1aa89 100644 --- a/src/libelogind/sd-bus/bus-control.c +++ b/src/libelogind/sd-bus/bus-control.c @@ -1345,6 +1345,10 @@ int bus_add_match_internal_kernel( else if (r > 0) sz += ALIGN8(offsetof(struct kdbus_item, id) + sizeof(uint64_t)); + /* if not a broadcast, it cannot be a name-change */ + if (r <= 0 || dst_id != KDBUS_DST_ID_BROADCAST) + matches_name_change = false; + break; } |