caps: define new CAP_* unconditionally

This commit is contained in:
Robert Swiecki 2023-09-17 10:48:17 +02:00
parent bc4e7fdd52
commit 3af3eac80f

23
caps.cc
View File

@ -35,6 +35,19 @@
#include "macros.h" #include "macros.h"
#include "util.h" #include "util.h"
#if !defined(CAP_AUDIT_READ)
#define CAP_AUDICAP_AUDIT_READ 37
#endif /* !defined(CAP_AUDIT_READ) */
#if !defined(CAP_PERFMON)
#define CAP_PERFMON 38
#endif /* !defined(CAP_PERFMON) */
#if !defined(CAP_BPF)
#define CAP_BPF 39
#endif /* !defined(CAP_BPF) */
#if !defined(CAP_CHECKPOINT_RESTORE)
#define CAP_CHECKPOINT_RESTORE 40
#endif /* !defined(CAP_CHECKPOINT_RESTORE) */
namespace caps { namespace caps {
struct { struct {
@ -78,18 +91,10 @@ struct {
NS_VALSTR_STRUCT(CAP_SYSLOG), NS_VALSTR_STRUCT(CAP_SYSLOG),
NS_VALSTR_STRUCT(CAP_WAKE_ALARM), NS_VALSTR_STRUCT(CAP_WAKE_ALARM),
NS_VALSTR_STRUCT(CAP_BLOCK_SUSPEND), NS_VALSTR_STRUCT(CAP_BLOCK_SUSPEND),
#if defined(CAP_AUDIT_READ)
NS_VALSTR_STRUCT(CAP_AUDIT_READ), NS_VALSTR_STRUCT(CAP_AUDIT_READ),
#endif /* defined(CAP_AUDIT_READ) */
#if defined(CAP_BPF)
NS_VALSTR_STRUCT(CAP_BPF),
#endif /* defined(CAP_BPF) */
#if defined(CAP_PERFMON)
NS_VALSTR_STRUCT(CAP_PERFMON), NS_VALSTR_STRUCT(CAP_PERFMON),
#endif /* defined(CAP_PERFMON) */ NS_VALSTR_STRUCT(CAP_BPF),
#if defined(CAP_CHECKPOINT_RESTORE)
NS_VALSTR_STRUCT(CAP_CHECKPOINT_RESTORE), NS_VALSTR_STRUCT(CAP_CHECKPOINT_RESTORE),
#endif /* defined(CAP_CHECKPOINT_RESTORE) */
}; };
int nameToVal(const char* name) { int nameToVal(const char* name) {