Lines Matching refs:capability

348 static void v1_update(capng_act_t action, unsigned int capability, __u32 *data)  in v1_update()  argument
351 *data |= MASK(capability); in v1_update()
353 *data &= ~(MASK(capability)); in v1_update()
356 static void update_effective(capng_act_t action, unsigned int capability, in update_effective() argument
360 m.data.v3[idx].effective |= MASK(capability); in update_effective()
362 m.data.v3[idx].effective &= ~(MASK(capability)); in update_effective()
365 static void update_permitted(capng_act_t action, unsigned int capability, in update_permitted() argument
369 m.data.v3[idx].permitted |= MASK(capability); in update_permitted()
371 m.data.v3[idx].permitted &= ~(MASK(capability)); in update_permitted()
374 static void update_inheritable(capng_act_t action, unsigned int capability, in update_inheritable() argument
378 m.data.v3[idx].inheritable |= MASK(capability); in update_inheritable()
380 m.data.v3[idx].inheritable &= ~(MASK(capability)); in update_inheritable()
383 static void update_bounding_set(capng_act_t action, unsigned int capability, in update_bounding_set() argument
388 m.bounds[idx] |= MASK(capability); in update_bounding_set()
390 m.bounds[idx] &= ~(MASK(capability)); in update_bounding_set()
394 int capng_update(capng_act_t action, capng_type_t type, unsigned int capability) in capng_update() argument
399 if (!cap_valid(capability)) { in capng_update()
406 v1_update(action, capability, &m.data.v1.effective); in capng_update()
408 v1_update(action, capability, &m.data.v1.permitted); in capng_update()
410 v1_update(action, capability, &m.data.v1.inheritable); in capng_update()
414 if (capability > 31) { in capng_update()
415 idx = capability>>5; in capng_update()
416 capability %= 32; in capng_update()
421 update_effective(action, capability, idx); in capng_update()
423 update_permitted(action, capability, idx); in capng_update()
425 update_inheritable(action, capability, idx); in capng_update()
427 update_bounding_set(action, capability, idx); in capng_update()
435 unsigned int capability, ...) in capng_updatev() argument
441 rc = capng_update(action, type, capability); in capng_updatev()
444 va_start(ap, capability); in capng_updatev()
739 static int check_effective(unsigned int capability, unsigned int idx) in check_effective() argument
741 return MASK(capability) & m.data.v3[idx].effective ? 1 : 0; in check_effective()
744 static int check_permitted(unsigned int capability, unsigned int idx) in check_permitted() argument
746 return MASK(capability) & m.data.v3[idx].permitted ? 1 : 0; in check_permitted()
749 static int check_inheritable(unsigned int capability, unsigned int idx) in check_inheritable() argument
751 return MASK(capability) & m.data.v3[idx].inheritable ? 1 : 0; in check_inheritable()
754 static int bounds_bit_check(unsigned int capability, unsigned int idx) in bounds_bit_check() argument
757 return MASK(capability) & m.bounds[idx] ? 1 : 0; in bounds_bit_check()
763 static int v1_check(unsigned int capability, __u32 data) in v1_check() argument
765 return MASK(capability) & data ? 1 : 0; in v1_check()
768 int capng_have_capability(capng_type_t which, unsigned int capability) in capng_have_capability() argument
777 if (m.cap_ver == 1 && capability > 31) in capng_have_capability()
779 if (!cap_valid(capability)) in capng_have_capability()
784 return v1_check(capability, m.data.v1.effective); in capng_have_capability()
786 return v1_check(capability, m.data.v1.permitted); in capng_have_capability()
788 return v1_check(capability, m.data.v1.inheritable); in capng_have_capability()
792 if (capability > 31) { in capng_have_capability()
793 idx = capability>>5; in capng_have_capability()
794 capability %= 32; in capng_have_capability()
799 return check_effective(capability, idx); in capng_have_capability()
801 return check_permitted(capability, idx); in capng_have_capability()
803 return check_inheritable(capability, idx); in capng_have_capability()
805 return bounds_bit_check(capability, idx); in capng_have_capability()