aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-08-20 15:35:53 +0200
committerLennart Poettering <lennart@poettering.net>2019-12-04 13:46:23 +0100
commit6f0245b3427626f2ff5780de4a356c45e2d1cd9b (patch)
tree6c6a0f06e22b93079945044896c362e3ce6010de
parentsd-bus: add new call sd_bus_message_sensitive() and SD_BUS_VTABLE_SENSITIVE (diff)
downloadsystemd-6f0245b3427626f2ff5780de4a356c45e2d1cd9b.tar.xz
systemd-6f0245b3427626f2ff5780de4a356c45e2d1cd9b.zip
sd-bus: don't include properties maked as "emit-invalidation" in InterfacesAdded signals
Properties marked this way really shouldn't be sent around willy-nilly, that's what the flag is about, hence exclude it from InterfacesAdded signals (and in fact anything that is a signal).
-rw-r--r--src/libsystemd/sd-bus/bus-objects.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 26f93d21dab..6d140348ec4 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -774,9 +774,18 @@ static int vtable_append_all_properties(
if (v->flags & SD_BUS_VTABLE_HIDDEN)
continue;
+ /* Let's not include properties marked as "explicit" in any message that contians a generic
+ * dump of properties, but only in those generated as a response to an explicit request. */
if (v->flags & SD_BUS_VTABLE_PROPERTY_EXPLICIT)
continue;
+ /* Let's not include properties marked only for invalidation on change (i.e. in contrast to
+ * those whose new values are included in PropertiesChanges message) in any signals. This is
+ * useful to ensure they aren't included in InterfacesAdded messages. */
+ if (reply->header->type != SD_BUS_MESSAGE_METHOD_RETURN &&
+ FLAGS_SET(v->flags, SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION))
+ continue;
+
r = vtable_append_one_property(bus, reply, path, c, v, userdata, error);
if (r < 0)
return r;