summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c10
-rw-r--r--src/libsystemd/sd-bus/kdbus.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 4ad44469b5..d9a53c702f 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -389,13 +389,17 @@ static int bus_get_owner_kdbus(
if (r < 0)
return r;
if (r > 0) {
- size = offsetof(struct kdbus_cmd_conn_info, name);
+ size = offsetof(struct kdbus_cmd_conn_info, items);
cmd = alloca0_align(size, 8);
cmd->id = id;
} else {
- size = offsetof(struct kdbus_cmd_conn_info, name) + strlen(name) + 1;
+ size_t item_size = KDBUS_ITEM_HEADER_SIZE + strlen(name) + 1;
+
+ size = offsetof(struct kdbus_cmd_conn_info, items) + item_size;
cmd = alloca0_align(size, 8);
- strcpy(cmd->name, name);
+ cmd->items[0].size = item_size;
+ cmd->items[0].type = KDBUS_ITEM_NAME;
+ strcpy(cmd->items[0].str, name);
}
cmd->size = size;
diff --git a/src/libsystemd/sd-bus/kdbus.h b/src/libsystemd/sd-bus/kdbus.h
index 7fb11713fc..c97994974b 100644
--- a/src/libsystemd/sd-bus/kdbus.h
+++ b/src/libsystemd/sd-bus/kdbus.h
@@ -681,7 +681,7 @@ struct kdbus_cmd_conn_info {
__u64 flags;
__u64 id;
__u64 offset;
- char name[0];
+ struct kdbus_item items[0];
} __attribute__((aligned(8)));
/**