Lines Matching refs:capability
20 #include <linux/capability.h>
29 #include "capability-util.h"
110 free(c->capability);
671 static int has_cap(sd_bus_creds *c, unsigned offset, int capability) {
675 assert(capability >= 0);
676 assert(c->capability);
678 if ((unsigned) capability > cap_last_cap())
683 return !!(c->capability[offset * sz + CAP_TO_INDEX(capability)] & CAP_TO_MASK(capability));
686 _public_ int sd_bus_creds_has_effective_cap(sd_bus_creds *c, int capability) {
688 assert_return(capability >= 0, -EINVAL);
693 return has_cap(c, CAP_OFFSET_EFFECTIVE, capability);
696 _public_ int sd_bus_creds_has_permitted_cap(sd_bus_creds *c, int capability) {
698 assert_return(capability >= 0, -EINVAL);
703 return has_cap(c, CAP_OFFSET_PERMITTED, capability);
706 _public_ int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c, int capability) {
708 assert_return(capability >= 0, -EINVAL);
713 return has_cap(c, CAP_OFFSET_INHERITABLE, capability);
716 _public_ int sd_bus_creds_has_bounding_cap(sd_bus_creds *c, int capability) {
718 assert_return(capability >= 0, -EINVAL);
723 return has_cap(c, CAP_OFFSET_BOUNDING, capability);
744 if (!c->capability) {
745 c->capability = new0(uint32_t, max * 4);
746 if (!c->capability)
763 c->capability[offset * max + (sz - i - 1)] = v;
1271 assert(c->capability);
1273 n->capability = memdup(c->capability, DIV_ROUND_UP(cap_last_cap(), 32U) * 4 * 4);
1274 if (!n->capability)