]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: show capabilities in human readable format
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 Aug 2017 08:07:16 +0000 (17:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 Aug 2017 08:07:28 +0000 (17:07 +0900)
Follow-up for 21771f338d268e06dc9a10b9b08b14ff8217d4be.

src/shared/bus-util.c

index a7fafb9be57fcb98c89a55902f504b3e54232a71..ea29e1c0dd6404d18fe84443459d3a88f8efd586 100644 (file)
@@ -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"
@@ -758,6 +759,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) ||