From 01a0a556018694bfaf6b01a5a40f8d0d10641a1f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 18 May 2023 10:26:02 +0200 Subject: [PATCH] lib/caputils: fix integer handling issues [coverity scan] Signed-off-by: Karel Zak --- lib/caputils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/caputils.c b/lib/caputils.c index 3041c3078..23866c071 100644 --- a/lib/caputils.c +++ b/lib/caputils.c @@ -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")); }