[apparmor] [patch] Make.rules: sort capabilities with LANG=C

Christian Boltz apparmor at cboltz.de
Tue Aug 25 17:09:19 UTC 2015


this patch changes Make.rules to sort capabilities using LANG=C.

This is needed to make building apparmor.vim reproducable - otherwise
the sorting depends on the locale.

Found by the Debian reproducible project,

[ make-rules-sort-capabilities.diff ]

=== modified file 'common/Make.rules'
--- common/Make.rules   2015-01-30 21:15:53 +0000
+++ common/Make.rules   2015-08-25 17:00:00 +0000
@@ -82,7 +82,7 @@
 # =====================
 # emits defined capabilities in a simple list, e.g. "CAP_NAME CAP_NAME2"
-CAPABILITIES=$(shell 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' | sort)
+CAPABILITIES=$(shell 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' | LANG=C sort)
 .PHONY: list_capabilities
 list_capabilities: /usr/include/linux/capability.h


Christian Boltz
> Ansonsten: Ich sage nur "Diwasserstoffmonoxid".
Ja, ein äußerst schädliches Zeugs, vor allem wenn es in
guten Malt gerät.         [A. Schreiber und R. Döblitz]

More information about the AppArmor mailing list