summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-30 04:14:10 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-30 14:46:14 +0100
commit49b832c5b810f4d8bb59249ff25472fd670503dc (patch)
treeff71bd5e8318578db77f85d21843a273b60fce4b /src/libsystemd-bus/bus-kernel.c
parent2377ae1ff6ee2987a300d4df17320c2d9c61d23d (diff)
bus: include unique and well known names in credentials object
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index b63fe56c41..51e882c73d 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -775,7 +775,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
case KDBUS_ITEM_CMDLINE:
m->creds.cmdline = d->str;
- m->creds.cmdline_length = l;
+ m->creds.cmdline_size = l;
m->creds.mask |= SD_BUS_CREDS_CMDLINE & bus->creds_mask;
break;
@@ -800,9 +800,14 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
destination = d->str;
break;
+ case KDBUS_ITEM_NAMES:
+ m->creds.well_known_names = d->str;
+ m->creds.well_known_names_size = l;
+ m->creds.mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES & bus->creds_mask;
+ break;
+
case KDBUS_ITEM_FDS:
case KDBUS_ITEM_SECLABEL:
- case KDBUS_ITEM_NAMES:
break;
default:
@@ -818,7 +823,8 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
m->sender = "org.freedesktop.DBus";
else {
snprintf(m->sender_buffer, sizeof(m->sender_buffer), ":1.%llu", (unsigned long long) k->src_id);
- m->sender = m->sender_buffer;
+ m->sender = m->creds.unique_name = m->sender_buffer;
+ m->creds.mask |= SD_BUS_CREDS_UNIQUE_NAME & bus->creds_mask;
}
if (!m->destination) {
@@ -1029,6 +1035,9 @@ int kdbus_translate_attach_flags(uint64_t mask, uint64_t *kdbus_mask) {
if (mask & (SD_BUS_CREDS_AUDIT_SESSION_ID|SD_BUS_CREDS_AUDIT_LOGIN_UID))
m |= KDBUS_ATTACH_AUDIT;
+ if (mask & SD_BUS_CREDS_WELL_KNOWN_NAMES)
+ m |= KDBUS_ATTACH_NAMES;
+
*kdbus_mask = m;
return 0;
}