]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/caputils: fix integer handling issues [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 18 May 2023 08:26:02 +0000 (10:26 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 18 May 2023 08:26:02 +0000 (10:26 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/caputils.c

index 3041c3078341048ee5ef0adf38139311187e5f74..23866c071f9977a5334caa154f696971892d6a67 100644 (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"));
        }