mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
parser: Move to a pre-generated cap_names.h
The auto-generated cap_names.h has problems when the parser if the parser is built against a kernel with a smaller capability list than the kernel policy is being compiled for. Moving to a pre-generated list lets us support all capabilities even when we build against older kernels. However we don't want to only use the pre-generated list as that would make it too easy to miss when a new capability has been added. Keep auto generating the caps list and compare it to the pre-generated caps list so we can detect when new capabilities are added, and fail the build so that the pre-generated list can be updated. We screen the diff for only additions so that the parser can continue to build on older kernels that don't have the full capability list without errors. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -165,6 +165,14 @@ static int get_table_token(const char *name unused, struct keyword_table *table,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef CAP_PERFMON
|
||||
#define CAP_PERFMON 38
|
||||
#endif
|
||||
|
||||
#ifndef CAP_BPF
|
||||
#define CAP_BPF 39
|
||||
#endif
|
||||
|
||||
static struct keyword_table capability_table[] = {
|
||||
/* capabilities */
|
||||
#include "cap_names.h"
|
||||
|
Reference in New Issue
Block a user