capability-util: introduce capability_get() and use it in have_effective_cap()
capability_get() is a wrapper of capget() syscall and converts its result to CapabilityQuintet. This also introduce have_inheritable_cap(), which is similar to have_effective_cap(). It is currently unused, but will be used later.
This commit is contained in:
@@ -43,8 +43,11 @@ static inline bool capability_is_set(uint64_t v) {
|
||||
return v != CAP_MASK_UNSET;
|
||||
}
|
||||
|
||||
int capability_get(CapabilityQuintet *ret);
|
||||
|
||||
unsigned cap_last_cap(void);
|
||||
int have_effective_cap(int value);
|
||||
int have_effective_cap(unsigned cap);
|
||||
int have_inheritable_cap(unsigned cap);
|
||||
int capability_gain_cap_setpcap(cap_t *ret_before_caps);
|
||||
int capability_bounding_set_drop(uint64_t keep, bool right_now);
|
||||
int capability_bounding_set_drop_usermode(uint64_t keep);
|
||||
|
||||
Reference in New Issue
Block a user