summaryrefslogtreecommitdiffstats
path: root/scripts/selinux/mdp
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2016-12-21 16:39:25 +0100
committerPaul Moore <paul@paul-moore.com>2016-12-21 16:39:25 +0100
commitbfc5e3a6af397dcf9c99a6c1872458e7867c4680 (patch)
tree09d7f23ed281538d97ead3b78691f2a33eee29ff /scripts/selinux/mdp
parentselinux: Convert isec->lock into a spinlock (diff)
downloadlinux-bfc5e3a6af397dcf9c99a6c1872458e7867c4680.tar.xz
linux-bfc5e3a6af397dcf9c99a6c1872458e7867c4680.zip
selinux: use the kernel headers when building scripts/selinux
Commit 3322d0d64f4e ("selinux: keep SELinux in sync with new capability definitions") added a check on the defined capabilities without explicitly including the capability header file which caused problems when building genheaders for users of clang/llvm. Resolve this by using the kernel headers when building genheaders, which is arguably the right thing to do regardless, and explicitly including the kernel's capability.h header file in classmap.h. We also update the mdp build, even though it wasn't causing an error we really should be using the headers from the kernel we are building. Reported-by: Nicolas Iooss <nicolas.iooss@m4x.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'scripts/selinux/mdp')
-rw-r--r--scripts/selinux/mdp/Makefile4
-rw-r--r--scripts/selinux/mdp/mdp.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/scripts/selinux/mdp/Makefile b/scripts/selinux/mdp/Makefile
index dba7eff69a00..d6a83cafe59f 100644
--- a/scripts/selinux/mdp/Makefile
+++ b/scripts/selinux/mdp/Makefile
@@ -1,5 +1,7 @@
hostprogs-y := mdp
-HOST_EXTRACFLAGS += -Isecurity/selinux/include
+HOST_EXTRACFLAGS += \
+ -I$(srctree)/include/uapi -I$(srctree)/include \
+ -I$(srctree)/security/selinux/include
always := $(hostprogs-y)
clean-files := policy.* file_contexts
diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
index e10beb11b696..c29fa4a6228d 100644
--- a/scripts/selinux/mdp/mdp.c
+++ b/scripts/selinux/mdp/mdp.c
@@ -24,6 +24,10 @@
* Authors: Serge E. Hallyn <serue@us.ibm.com>
*/
+
+/* NOTE: we really do want to use the kernel headers here */
+#define __EXPORTED_HEADERS__
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>