};
struct __user_cap_data_struct payload[_LINUX_CAPABILITY_U32S_3] = {{ 0 }};
- int cap;
- uint64_t effective;
+ uint64_t effective, cap;
if (capget(&header, payload) < 0)
err(EXIT_FAILURE, _("capget failed"));
effective = ((uint64_t)payload[1].effective << 32) | (uint64_t)payload[0].effective;
- for (cap = 0; cap < 64; cap++) {
+ for (cap = 0; cap < (sizeof(effective) * 8); cap++) {
/* This is the same check as cap_valid(), but using
* the runtime value for the last valid cap. */
- if (cap > cap_last_cap())
+ if (cap > (uint64_t) cap_last_cap())
continue;
if ((effective & (1 << cap))