summaryrefslogtreecommitdiff
path: root/src/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-11 22:30:31 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-11 22:30:31 +0200
commit64685e0cea62b4937f0804e47ce2cb7929f58223 (patch)
treeb33dc0e8922360c9f067591cafa8632f2b26ea58 /src/execute.c
parentd2134abdd5a21bb7e4b307f403d890901628fcf9 (diff)
util: properly detect what the last capability is
Diffstat (limited to 'src/execute.c')
-rw-r--r--src/execute.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/execute.c b/src/execute.c
index 53e7e77fde..866e8bf2f6 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -895,12 +895,9 @@ static int do_capability_bounding_set_drop(uint64_t drop) {
}
}
- for (i = 0; i <= MAX(63LU, (unsigned long) CAP_LAST_CAP); i++)
+ for (i = 0; i <= 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;
}
@@ -1720,7 +1717,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
unsigned long l;
fprintf(f, "%sCapabilityBoundingSet:", prefix);
- for (l = 0; l <= (unsigned long) CAP_LAST_CAP; l++)
+ for (l = 0; l <= cap_last_cap(); l++)
if (!(c->capability_bounding_set_drop & ((uint64_t) 1ULL << (uint64_t) l))) {
char *t;