summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-21 20:58:09 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-21 20:58:09 +0200
commit1386e47db5d627ef29664fc8a28b1065dcb7f197 (patch)
tree54fda7616a3f33864b9d2a88378bb2f8e0404198 /src/libsystemd/sd-bus/bus-kernel.c
parent3bd3150367f5751e4d1dff8e070d2deb3be3489a (diff)
sd-bus: expose ppid field
kdbus has been passing us the ppid file for a while, actually make use of it.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 0062e66d39..a8c04b98a9 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -595,6 +595,11 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
m->creds.mask |= SD_BUS_CREDS_TID & bus->creds_mask;
}
+ if (d->pids.ppid > 0) {
+ m->creds.ppid = (pid_t) d->pids.ppid;
+ m->creds.mask |= SD_BUS_CREDS_PPID & bus->creds_mask;
+ }
+
break;
case KDBUS_ITEM_CREDS:
@@ -1506,7 +1511,7 @@ uint64_t attach_flags_to_kdbus(uint64_t mask) {
SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID))
m |= KDBUS_ATTACH_CREDS;
- if (mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_TID))
+ if (mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_TID|SD_BUS_CREDS_PPID))
m |= KDBUS_ATTACH_PIDS;
if (mask & SD_BUS_CREDS_COMM)