diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-08-31 17:07:16 +0900 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-08-31 17:07:16 +0900 |
commit | a8b0a8ad0bc16ed9d2838808bd71ceec63859b83 (patch) | |
tree | cd0750c025192a3012342e61fefd950b20e0fb1d /src/shared/bus-util.c | |
parent | 6e8d034a3743e0e1542cb92f6d70427b4e46de46 (diff) |
systemctl: show capabilities in human readable format
Follow-up for 21771f338d268e06dc9a10b9b08b14ff8217d4be.
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 2678cc9b0..69bbf5782 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -39,6 +39,7 @@ #include "bus-label.h" #include "bus-message.h" #include "bus-util.h" +#include "cap-list.h" #include "cgroup-util.h" #include "def.h" #include "escape.h" @@ -762,6 +763,15 @@ int bus_print_property(const char *name, sd_bus_message *property, bool value, b print_property(name, "%s", result); + } else if (STR_IN_SET(name, "CapabilityBoundingSet", "AmbientCapabilities")) { + _cleanup_free_ char *s = NULL; + + r = capability_set_to_string_alloc(u, &s); + if (r < 0) + return r; + + print_property(name, "%s", s); + } else if ((STR_IN_SET(name, "CPUWeight", "StartupCPUWeight", "IOWeight", "StartupIOWeight") && u == CGROUP_WEIGHT_INVALID) || (STR_IN_SET(name, "CPUShares", "StartupCPUShares") && u == CGROUP_CPU_SHARES_INVALID) || (STR_IN_SET(name, "BlockIOWeight", "StartupBlockIOWeight") && u == CGROUP_BLKIO_WEIGHT_INVALID) || |