[apparmor] [patch] Make.rules: sort capabilities with LANG=C
Seth Arnold
seth.arnold at canonical.com
Tue Aug 25 19:37:22 UTC 2015
On Tue, Aug 25, 2015 at 09:30:58PM +0200, Christian Boltz wrote:
> > Isn't LC_COLLATE=C needed as well? IIRC if it's set it can override
> > $LANG for some aspects of sorting.
>
> Good question, let's test it ;-)
> [ 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' | LC_ALL=C sort)
>
> .PHONY: list_capabilities
> list_capabilities: /usr/include/linux/capability.h
Nice catch :)
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150825/a3c0cf28/attachment.pgp>
More information about the AppArmor
mailing list