}
}
- for (i = 0; i <= CAP_LAST_CAP; i++)
+ for (i = 0; i <= MAX(63LU, (unsigned long) CAP_LAST_CAP); i++)
if (drop & ((uint64_t) 1ULL << (uint64_t) i)) {
if (prctl(PR_CAPBSET_DROP, i) < 0) {
+ if (errno == EINVAL)
+ break;
+
r = -errno;
goto finish;
}
(c->secure_bits & SECURE_NOROOT_LOCKED) ? "noroot-locked" : "");
if (c->capability_bounding_set_drop) {
+ unsigned long l;
fprintf(f, "%sCapabilityBoundingSet:", prefix);
- for (i = 0; i <= CAP_LAST_CAP; i++)
- if (!(c->capability_bounding_set_drop & ((uint64_t) 1ULL << (uint64_t) i))) {
+ for (l = 0; l <= (unsigned long) CAP_LAST_CAP; l++)
+ if (!(c->capability_bounding_set_drop & ((uint64_t) 1ULL << (uint64_t) l))) {
char *t;
- if ((t = cap_to_name(i))) {
+ if ((t = cap_to_name(l))) {
fprintf(f, " %s", t);
cap_free(t);
}
unsigned long l;
- for (l = 0; l <= MAX(63LU, (unsigned long) CAP_LAST_CAP); l ++) {
+ for (l = 0; l <= MAX(63LU, (unsigned long) CAP_LAST_CAP); l++) {
unsigned i;
for (i = 0; i < ELEMENTSOF(retain); i++)
/* If this capability is not known, EINVAL
* will be returned, let's ignore this. */
if (errno == EINVAL)
- continue;
+ break;
log_error("PR_CAPBSET_DROP failed: %m");
return -errno;