capability-util: make CAPABILITY_QUINTET_NULL const, introduce capability_quintet_is_fully_set() helper

Follow-up for 1184626a26

See 9bb64f1b8d for rationale
of the first change.
This commit is contained in:
Mike Yuan
2024-12-28 15:08:00 +01:00
parent d5e12dc75e
commit 6f3854fd63
2 changed files with 18 additions and 15 deletions
+1 -5
View File
@@ -661,11 +661,7 @@ int pidref_get_capability(const PidRef *pidref, CapabilityQuintet *ret) {
}
}
if (q.effective == CAP_MASK_UNSET ||
q.inheritable == CAP_MASK_UNSET ||
q.permitted == CAP_MASK_UNSET ||
q.effective == CAP_MASK_UNSET ||
q.ambient == CAP_MASK_UNSET)
if (!capability_quintet_is_fully_set(&q))
return -EBADMSG;
r = pidref_verify(pidref);