capability: also cap CAP_LAST_CAP at 63
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Mar 2019 11:37:30 +0000 (12:37 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Mar 2019 11:37:30 +0000 (12:37 +0100)
src/basic/capability-util.c

index 2c17e26..03a6b66 100644 (file)
@@ -61,7 +61,7 @@ unsigned long cap_last_cap(void) {
         }
 
         /* fall back to syscall-probing for pre linux-3.2 */
-        p = (unsigned long) CAP_LAST_CAP;
+        p = MIN((unsigned long) CAP_LAST_CAP, 63U);
 
         if (prctl(PR_CAPBSET_READ, p) < 0) {