capability-util: tighten requirement for CAP_LAST_CAP off by one

Otherwise, we cannot use UINT64_MAX as 'unset'.
This commit is contained in:
Yu Watanabe
2025-10-24 01:52:18 +09:00
parent 2a6b084cc6
commit 4c0cdc4a2c
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -241,11 +241,9 @@ static void test_ensure_cap_64_bit(void) {
ASSERT_OK(safe_atolu(content, &p));
/* If caps don't fit into 64-bit anymore, we have a problem, fail the test. */
assert_se(p <= 63);
/* Also check for the header definition */
assert_cc(CAP_LAST_CAP <= 63);
/* If caps don't fit into 64-bit anymore, we have a problem, fail the test. Moreover, we use
* UINT64_MAX as unset, hence it must be smaller than or equals to 62 (CAP_LIMIT). */
assert_se(p <= CAP_LIMIT);
}
static void test_capability_get_ambient(void) {