summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-12-12 14:02:57 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-12-12 14:02:57 +0100
commit19ee32dc4d337a033c95c7d3302666f2ea4340bd (patch)
treed3e5f6368e64c29542777acdae0cb6de0b8f8afd
parent18ee085c155dcd5f196f2ef9b712698dfd377f82 (diff)
bus: send attach flags on BUS_MAKE
Make sure to set send-attach-flags on BUS_MAKE. These control which information is revealed about the bus-owner.
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index d910d8e492..cdca48d92b 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1510,6 +1510,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
make = alloca0_align(offsetof(struct kdbus_cmd_make, items) +
ALIGN8(offsetof(struct kdbus_item, bloom_parameter) + sizeof(struct kdbus_bloom_parameter)) +
ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)) +
+ ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)) +
ALIGN8(offsetof(struct kdbus_item, str) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1),
8);
@@ -1536,6 +1537,13 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
n->data64[0] = _KDBUS_ATTACH_ANY;
make->size += ALIGN8(n->size);
+ /* Provide all metadata via bus-owner queries */
+ n = KDBUS_ITEM_NEXT(n);
+ n->type = KDBUS_ITEM_ATTACH_FLAGS_SEND;
+ n->size = offsetof(struct kdbus_item, data64) + sizeof(uint64_t);
+ n->data64[0] = _KDBUS_ATTACH_ANY;
+ make->size += ALIGN8(n->size);
+
/* Set the a good name */
n = KDBUS_ITEM_NEXT(n);
sprintf(n->str, UID_FMT "-%s", getuid(), name);