lib/caputils: fix integer handling issues [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2023-05-18 10:26:02 +02:00
parent 03a8f430c5
commit 01a0a55601

View file

@ -119,7 +119,7 @@ void cap_permitted_to_ambient(void)
if (cap > (uint64_t) cap_last_cap())
continue;
if ((effective & (1 << cap))
if ((effective & (1ULL << cap))
&& prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0, 0) < 0)
err(EXIT_FAILURE, _("prctl(PR_CAP_AMBIENT) failed"));
}