diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-24 19:31:44 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-24 19:31:44 +0100 |
commit | 751bc6ac79320bc16e63e8c1bbb713c30a3b7bc9 (patch) | |
tree | 513508ade203dc372d6aabbfcb8bf5e6cc490dc6 /src/libsystemd-bus/bus-kernel.c | |
parent | 4e6a9570b698b335c6f59ec3556dfb3e95817d75 (diff) |
bus: properly shift cgroup data returned from kdbus by the container's root before parsing
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r-- | src/libsystemd-bus/bus-kernel.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c index 19d97b7e00..8a5b210fe4 100644 --- a/src/libsystemd-bus/bus-kernel.c +++ b/src/libsystemd-bus/bus-kernel.c @@ -35,6 +35,7 @@ #include "bus-kernel.h" #include "bus-bloom.h" #include "bus-util.h" +#include "cgroup-util.h" #define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t)) @@ -845,6 +846,15 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { case KDBUS_ITEM_CGROUP: m->creds.cgroup = d->str; m->creds.mask |= (SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID) & bus->creds_mask; + + if (!bus->cgroup_root) { + r = cg_get_root_path(&bus->cgroup_root); + if (r < 0) + goto fail; + } + + m->creds.cgroup_root = bus->cgroup_root; + break; case KDBUS_ITEM_AUDIT: |