2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-26 20:17:21 +00:00
apparmor/common/list_capabilities.sh
allgdante 0d8e4cda3f
Generate CAPABILITIES in a script due to make 4.3
This way we could generate the capabilities in a way that works with
every version of make.
Changes to list_capabilities are intended to exactly replicate the old
behavior.

(cherry picked from commit e92da079ca12e776991bd36524430bd67c1cb72a)
2020-03-31 20:57:53 +02:00

15 lines
401 B
Bash
Executable File

#!/bin/bash -e
# =====================
# generate list of capabilities based on
# /usr/include/linux/capabilities.h for use in multiple locations in
# the source tree
# =====================
echo "#include <linux/capability.h>" | \
cpp -dM | \
LC_ALL=C sed -n \
-e '/CAP_EMPTY_SET/d' \
-e 's/^\#define[ \t]\+CAP_\([A-Z0-9_]\+\)[ \t]\+\([0-9xa-f]\+\)\(.*\)$/CAP_\1/p' | \
LC_ALL=C sort