diff -u apparmor-2.3.1+1403/parser/Makefile apparmor-2.3.1+1403/parser/Makefile --- apparmor-2.3.1+1403/parser/Makefile +++ apparmor-2.3.1+1403/parser/Makefile @@ -182,14 +182,15 @@ @mv -f .ver $@ # These are the families that it doesn't make sense for apparmor to mediate. -FILTER_FAMILIES=AF_RXRPC AF_MAX AF_UNSPEC AF_UNIX AF_LOCAL AF_NETLINK AF_LLC AF_IUCV AF_TIPC AF_CAN AF_ISDN AF_PHONET +# We use PF_ here since that is what is required in bits/socket.h, but we will +# rewrite these as AF_. +FILTER_FAMILIES=PF_RXRPC PF_MAX PF_UNSPEC PF_UNIX PF_LOCAL PF_NETLINK PF_LLC PF_IUCV PF_TIPC PF_CAN PF_ISDN PF_PHONET __FILTER=$(shell echo $(strip $(FILTER_FAMILIES)) | sed -e 's/ /\\\|/g') -af_names.h: /usr/include/linux/socket.h - LC_ALL=C sed -n -e '/$(__FILTER)/d' -e "s/^\#define[ \\t]\\+AF_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/#ifndef AF_\\1\\n# define AF_\\1 \\2\\n#endif\\nAA_GEN_NET_ENT(\"\\L\\1\", \\UAF_\\1)\\n/p" $< > $@ - # define local AF_MAX which may differ from that of bits/socket.h - LC_ALL=C sed -n -e "s/^\#define[ \\t]\\+\\(AF_MAX\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/#define AA_\\1 \\2\n/p" $< >> $@ +af_names.h: /usr/include/bits/socket.h + LC_ALL=C sed -n -e '/$(__FILTER)/d' -e "s/^\#define[ \\t]\\+PF_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/#ifndef AF_\\1\\n# define AF_\\1 \\2\\n#endif\\nAA_GEN_NET_ENT(\"\\L\\1\", \\UAF_\\1)\\n/p" $< > $@ + LC_ALL=C sed -n -e "s/^\#define[ \\t]\\+PF_MAX[ \\t]\\+\\([0-9]\\+\\)[ \\t]\\+.*/#define AA_AF_MAX \\1\n/p" $< >> $@ cat $@ cap_names.h: /usr/include/linux/capability.h