chiark / gitweb /
sd-bus: don't list activators as proper peers
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 24 Aug 2015 11:41:03 +0000 (13:41 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:18:46 +0000 (10:18 +0100)
If a connection passed KDBUS_HELLO_ACTIVATOR, it cannot do I/O on the
bus. Hence, we should not treat it as proper peer. To actually query it,
you have to explicitly ask for activators.

This makes kdbus in-line with what dbus-daemon does.

src/libelogind/sd-bus/bus-control.c

index 3cdce6600387e99e1cc8774dc25f69dca85b0e20..feed51cd94e61a473048d48c6f302ad2387e64f6 100644 (file)
@@ -258,7 +258,7 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
         KDBUS_FOREACH(name, name_list, cmd.list_size) {
                 struct kdbus_item *item;
 
-                if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id) {
+                if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id && !(name->flags & KDBUS_HELLO_ACTIVATOR)) {
                         char *n;
 
                         if (asprintf(&n, ":1.%llu", (unsigned long long) name->id) < 0) {