Commit 2ecb9f7d authored by Eamon Walsh's avatar Eamon Walsh

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's avatarEamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent 9fc6b59d
......@@ -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);
......
......@@ -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
......
......@@ -446,6 +446,4 @@
#include "dix-config-apple-verbatim.h"
#endif
#undef HAVE_AVC_NETLINK_ACQUIRE_FD
#endif /* _DIX_CONFIG_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment