cap-list: refuse parsing numeric capability 63

We refuse it otherwise currently, simply because we cannot store it in a
uint64_t caps mask value anymore while retaining the ability to use
UINT64_MAX as "unset" marker.

The check actually was in place already, just one off.
This commit is contained in:
Lennart Poettering
2023-02-20 16:13:49 +01:00
parent 3f444e94f5
commit d0e67c69ba
3 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -35,10 +35,10 @@ int capability_from_name(const char *name) {
/* Try to parse numeric capability */
r = safe_atoi(name, &i);
if (r >= 0) {
if (i >= 0 && i < 64)
return i;
else
if (i < 0 || i >= 63)
return -EINVAL;
return i;
}
/* Try to parse string capability */