summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-07-30 05:59:34 +0000
committerHavoc Pennington <hp@redhat.com>2004-07-30 05:59:34 +0000
commit1e9b185b0c274ef0d684b1e43418388225321e72 (patch)
tree66bb08beb9ea1b4250953294134e2c995f8adf34 /configure.in
parent4076d31c71bee332c4a697597a93345b45850b33 (diff)
2004-07-24 Havoc Pennington <hp@redhat.com>
SELinux support from Matthew Rickard <mjricka@epoch.ncsc.mil> * bus/selinux.c, bus/selinux.h: new file encapsulating selinux functionality * configure.in: add --enable-selinux * bus/policy.c (bus_policy_merge): add FIXME to a comment * bus/main.c (main): initialize and shut down selinux * bus/connection.c: store SELinux ID on each connection, to avoid repeated getting of the string context and converting it into an ID * bus/bus.c (bus_context_get_policy): new accessor, though it isn't used (bus_context_check_security_policy): check whether the security context of sender connection can send to the security context of recipient connection * bus/config-parser.c: add parsing for <selinux> and <associate> * dbus/dbus-transport.c (_dbus_transport_get_unix_fd): to implement dbus_connection_get_unix_fd() * dbus/dbus-connection.c (dbus_connection_get_unix_fd): new function, used by the selinux stuff
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in40
1 files changed, 37 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 2c18dd45..67f971c6 100644
--- a/configure.in
+++ b/configure.in
@@ -38,7 +38,7 @@ AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],ena
AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=auto)
AC_ARG_ENABLE(mono_docs, [ --enable-mono-docs build mono docs],enable_mono_docs=$enableval,enable_mono_docs=auto)
AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
-
+AC_ARG_ENABLE(selinux, [ --enable-selinux build with SELinux support],enable_selinux=$enableval,enable_selinux=auto)
AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
@@ -690,6 +690,40 @@ if $dbus_use_libxml; then
XML_CFLAGS=$LIBXML_CFLAGS
fi
+# SELinux detection
+if test x$enable_selinux = xno ; then
+ have_selinux=no;
+else
+ # See if we have SELinux library
+ AC_CHECK_LIB(selinux, is_selinux_enabled,
+ have_selinux=yes, have_selinux=no)
+
+ # see if we have the SELinux header with the new D-BUS stuff in it
+ if test x$have_selinux = xyes ; then
+ AC_EGREP_HEADER(DBUS__ACQUIRE_SVC, av_permissions.h,
+ have_selinux=yes, have_selinux=no)
+ fi
+
+ if test x$enable_selinux = xauto ; then
+ if test x$have_selinux = xno ; then
+ AC_MSG_WARN([Sufficiently new SELinux library not found])
+ fi
+ else
+ if test x$have_selinux = xno ; then
+ AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
+ fi
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
+
+if test x$have_selinux = xyes ; then
+ SELINUX_LIBS=-lselinux
+ AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
+else
+ SELINUX_LIBS=
+fi
+
#### Set up final flags
DBUS_CLIENT_CFLAGS=
DBUS_CLIENT_LIBS=
@@ -697,7 +731,7 @@ AC_SUBST(DBUS_CLIENT_CFLAGS)
AC_SUBST(DBUS_CLIENT_LIBS)
DBUS_BUS_CFLAGS=$XML_CFLAGS
-DBUS_BUS_LIBS=$XML_LIBS
+DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS"
AC_SUBST(DBUS_BUS_CFLAGS)
AC_SUBST(DBUS_BUS_LIBS)
@@ -1076,7 +1110,6 @@ fi
AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
-
AC_OUTPUT([
Doxyfile
dbus/dbus-arch-deps.h
@@ -1167,6 +1200,7 @@ echo "
Building Qt bindings: ${have_qt}
Building GLib bindings: ${have_glib}
Building Python bindings: ${have_python}
+ Building SELinux support: ${have_selinux}
Building Mono bindings: ${enable_mono}
Building Mono docs: ${enable_mono_docs}
Building GTK+ tools: ${have_gtk}