nixos/security.wrappers: include CAP_LAST_CAP when raising ambient capabilities

(cherry picked from commit dfba3a7bc1)
This commit is contained in:
Linus Jäger
2026-07-06 07:18:33 +02:00
committed by github-actions[bot]
parent 0fc26a9f32
commit 9a49e60e28

View File

@@ -116,7 +116,7 @@ static int make_caps_ambient(const char *self_path) {
return 1;
}
uint64_t set = user_data[0].permitted | (uint64_t)user_data[1].permitted << 32;
for (unsigned cap = 0; cap < last_cap; cap++) {
for (unsigned cap = 0; cap <= last_cap; cap++) {
if (!(set & (1ULL << cap))) {
continue;
}