chiark / gitweb /
bus: do not dispatch incoming method calls that are broacasted to vtables
[elogind.git] / src / libsystemd-bus / bus-objects.c
index 941c2810d877136750386adb1799f41c6adb15a4..204e21d5d89e6102ac0eb3622267e0453d7e2631 100644 (file)
@@ -633,10 +633,16 @@ static int vtable_append_all_properties(
         assert(path);
         assert(c);
 
+        if (c->vtable[0].flags & SD_BUS_VTABLE_HIDDEN)
+                return 1;
+
         for (v = c->vtable+1; v->type != _SD_BUS_VTABLE_END; v++) {
                 if (v->type != _SD_BUS_VTABLE_PROPERTY && v->type != _SD_BUS_VTABLE_WRITABLE_PROPERTY)
                         continue;
 
+                if (v->flags & SD_BUS_VTABLE_HIDDEN)
+                        continue;
+
                 r = sd_bus_message_open_container(reply, 'e', "sv");
                 if (r < 0)
                         return r;
@@ -853,6 +859,9 @@ static int process_introspect(
 
                 empty = false;
 
+                if (c->vtable[0].flags & SD_BUS_VTABLE_HIDDEN)
+                        continue;
+
                 if (!streq_ptr(previous_interface, c->interface)) {
 
                         if (previous_interface)
@@ -1275,6 +1284,10 @@ int bus_process_object(sd_bus *bus, sd_bus_message *m) {
         if (hashmap_isempty(bus->nodes))
                 return 0;
 
+        /* Never respond to broadcast messages */
+        if (bus->bus_client && !m->destination)
+                return 0;
+
         assert(m->path);
         assert(m->member);