summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2009-10-21 19:28:26 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2010-02-22 17:03:50 -0500
commit2ecb9f7d86117f212d7845741a3e155553954a85 (patch)
treef456def61ba78c6619f5e31ad885b6584897c112
parent9fc6b59d46382e949526dc10c3f5bfddbe2acb92 (diff)
libselinux now has a pkgconfig file. Use it.
Also remove HAVE_NETLINK_AVC_ACQUIRE_FD tests, because we now require a version of libselinux that has it. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--Xext/xselinux_hooks.c6
-rw-r--r--configure.ac11
-rw-r--r--include/dix-config.h.in2
3 files changed, 3 insertions, 16 deletions
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 6e8c86d1f..72732e702 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -881,7 +881,6 @@ SELinuxObjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
sidput(obj->sid);
}
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
static int netlink_fd;
static void
@@ -895,7 +894,6 @@ SELinuxWakeupHandler(void *data, int err, void *read_mask)
if (FD_ISSET(netlink_fd, (fd_set *)read_mask))
avc_netlink_check_nb();
}
-#endif
void
SELinuxFlaskReset(void)
@@ -919,12 +917,10 @@ SELinuxFlaskReset(void)
/* Tear down SELinux stuff */
audit_close(audit_fd);
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
avc_netlink_release_fd();
RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
NULL);
RemoveGeneralSocket(netlink_fd);
-#endif
avc_destroy();
avc_active = 0;
@@ -992,12 +988,10 @@ SELinuxFlaskInit(void)
if (atom_client_ctx == BAD_RESOURCE)
FatalError("SELinux: Failed to create atom\n");
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
netlink_fd = avc_netlink_acquire_fd();
AddGeneralSocket(netlink_fd);
RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
NULL);
-#endif
/* Register callbacks */
ret &= dixRegisterPrivateInitFunc(subjectKey, SELinuxSubjectInit, NULL);
diff --git a/configure.ac b/configure.ac
index de252f323..b9c75742a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1056,16 +1056,11 @@ if test "x$XSELINUX" = xyes; then
if test "x$XACE" != xyes; then
AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
fi
- AC_CHECK_HEADERS([selinux/selinux.h selinux/avc.h], [], AC_MSG_ERROR([SELinux include files not found]))
- AC_CHECK_LIB(selinux, avc_init, [], AC_MSG_ERROR([SELinux library not found]))
AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
- AC_CHECK_DECL(avc_netlink_acquire_fd,
- [AC_DEFINE(HAVE_AVC_NETLINK_ACQUIRE_FD, 1, "Have avc_netlink_acquire_fd")],
- [],
- [#include <selinux/avc.h>])
+ PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.86])
+ SELINUX_LIBS="$SELINUX_LIBS -laudit"
AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
- SELINUX_LIB="-lselinux -laudit"
fi
AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
@@ -1584,7 +1579,7 @@ if test "x$XORG" = xyes; then
AC_CHECK_FUNCS([pci_device_vgaarb_init])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
- XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB"
+ XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
case $host_os in
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index e942dacf7..058c8fd14 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -446,6 +446,4 @@
#include "dix-config-apple-verbatim.h"
#endif
-#undef HAVE_AVC_NETLINK_ACQUIRE_FD
-
#endif /* _DIX_CONFIG_H_ */