diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-04-23 19:43:40 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-04-23 19:43:40 +0200 |
commit | 4761e880aea33d06be9c6f198e4dcf5efb3baa9e (patch) | |
tree | 15d3ba37ea2e1f29ebfa3ef2264eb8c1e6f1bdcc /src/libsystemd/sd-bus/bus-dump.c | |
parent | 33c62dcbd78dd42603a0d8989a150e816e0414d9 (diff) |
sd-bus: add controlling tty field to sd_creds object
This is useful to print wall messages from logind with the right client
tty. (to be added in a later patch)
Diffstat (limited to 'src/libsystemd/sd-bus/bus-dump.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-dump.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c index 13ff8b956a..396bf36f8a 100644 --- a/src/libsystemd/sd-bus/bus-dump.c +++ b/src/libsystemd/sd-bus/bus-dump.c @@ -364,8 +364,10 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse) { fprintf(f, "%sTID=%s"PID_FMT"%s", prefix, color, c->tid, suffix); if (c->mask & SD_BUS_CREDS_PPID) fprintf(f, "%sPPID=%s"PID_FMT"%s", prefix, color, c->ppid, suffix); + if (c->mask & SD_BUS_CREDS_TTY) + fprintf(f, "%sTTY=%s%s%s", prefix, color, strna(c->tty), suffix); - if (terse && ((c->mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_TID|SD_BUS_CREDS_PPID)))) + if (terse && ((c->mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_TID|SD_BUS_CREDS_PPID|SD_BUS_CREDS_TTY)))) fputs("\n", f); if (c->mask & SD_BUS_CREDS_UID) |