diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-25 11:23:59 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-09-25 11:23:59 +0200 |
commit | e967f5af047cdd82b7a3a9bd88359d75791e4189 (patch) | |
tree | 6e67175b2171e017d1b048e0d08da3d4a259c633 /src | |
parent | b32efd4b179b958d57653f4cc074413307e7dab1 (diff) |
shared/bus-util: format uid==-1 and gid==-1 as [not set]
$ systemctl show elogind-journald -p UID,GID
UID=4294967295
GID=4294967295
↓
$ systemctl show elogind-journald -p UID,GID
UID=[not set]
GID=[not set]
Just seeing the number is very misleading.
Fixes #6511.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/bus-util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 33ab89b23..f3579d07e 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -813,7 +813,17 @@ int bus_print_property(const char *name, sd_bus_message *property, bool value, b if (strstr(name, "UMask") || strstr(name, "Mode")) print_property(name, "%04o", u); - else + else if (streq(name, "UID")) { + if (u == UID_INVALID) + print_property(name, "%s", "[not set]"); + else + print_property(name, "%"PRIu32, u); + } else if (streq(name, "GID")) { + if (u == GID_INVALID) + print_property(name, "%s", "[not set]"); + else + print_property(name, "%"PRIu32, u); + } else print_property(name, "%"PRIu32, u); return 1; |