summaryrefslogtreecommitdiff
path: root/src/shared/capability.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/capability.h')
-rw-r--r--src/shared/capability.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/capability.h b/src/shared/capability.h
index 59469e56cb..64f86410ab 100644
--- a/src/shared/capability.h
+++ b/src/shared/capability.h
@@ -23,8 +23,20 @@
#include <inttypes.h>
#include <stdbool.h>
+#include <sys/capability.h>
+
+#include "util.h"
unsigned long cap_last_cap(void);
int have_effective_cap(int value);
int capability_bounding_set_drop(uint64_t drop, bool right_now);
int capability_bounding_set_drop_usermode(uint64_t drop);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(cap_t, cap_free);
+#define _cleanup_cap_free_ _cleanup_(cap_freep)
+
+static inline void cap_free_charpp(char **p) {
+ if (*p)
+ cap_free(*p);
+}
+#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp)