[apparmor] [PATCH] non-Linux library compilation

Kees Cook kees at ubuntu.com
Mon May 2 20:05:18 UTC 2011


On Hurd and kfreebsd under Debian, I have disabled the build of the parser
since things go extremely badly when capabilities disappear. If someone
wants to work on it, I have some initial patch attempts, but it was getting
too time-consuming, so I back-burnered the parser. A very small change was
needed to get the libraries to build, and this is it.

Description: Workaround non-Linux environments to build everything but the
 parser.
Author: Kees Cook <kees at debian.org>

Index: apparmor-debian/libraries/libapparmor/src/kernel_interface.c
===================================================================
--- apparmor-debian.orig/libraries/libapparmor/src/kernel_interface.c	2011-05-01 19:21:58.060889264 -0700
+++ apparmor-debian/libraries/libapparmor/src/kernel_interface.c	2011-05-01 19:22:20.491201437 -0700
@@ -37,7 +37,11 @@
 	int rc = -1;
 	int fd, ret, ctlerr = 0;
 	char *ctl = NULL;
+#ifdef SYS_gettid
 	pid_t tid = syscall(SYS_gettid);
+#else
+	pid_t tid = getpid();
+#endif
 
 	if (!buf) {
 		errno = EINVAL;

-- 
Kees Cook
Ubuntu Security Team



More information about the AppArmor mailing list