mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
b3259b6a2b
If libselinux is detected on your system at configure time link against it. This allows us to use a library call to detect if selinux is enabled and if it is to pass the mount option: "context=\"system_u:object_r:file_t:s0" For now this is required because none of the existing selinux policies are aware of the zfs filesystem type. Because of this they do not properly enable xattr based labeling even though zfs supports all of the required hooks. Until distro's add zfs as a known xattr friendly fs type we must use mntpoint labeling. Alternately, end users could modify their existing selinux policy with a little guidance.
37 lines
960 B
Plaintext
37 lines
960 B
Plaintext
dnl #
|
|
dnl # Check to see if the selinux libraries are available. If they
|
|
dnl # are then they will be consulted during mount to determine if
|
|
dnl # selinux is enabled or disabled.
|
|
dnl #
|
|
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBSELINUX], [
|
|
AC_ARG_WITH([selinux],
|
|
[AS_HELP_STRING([--with-selinux],
|
|
[support selinux @<:@default=check@:>@])],
|
|
[],
|
|
[with_selinux=check])
|
|
|
|
LIBSELINUX=
|
|
AS_IF([test "x$with_selinux" != xno], [
|
|
AC_CHECK_HEADER([selinux/selinux.h], [
|
|
AC_CHECK_LIB([selinux], [is_selinux_enabled], [
|
|
AC_SUBST([LIBSELINUX], ["-lselinux"])
|
|
AC_DEFINE([HAVE_LIBSELINUX], 1,
|
|
[Define if you have selinux])
|
|
], [
|
|
AS_IF([test "x$with_selinux" != xcheck],
|
|
[AC_MSG_FAILURE(
|
|
[--with-selinux given but unavailable])
|
|
])
|
|
])
|
|
], [
|
|
AS_IF([test "x$with_selinux" != xcheck],
|
|
[AC_MSG_FAILURE(
|
|
[--with-selinux given but unavailable])
|
|
])
|
|
])
|
|
], [
|
|
AC_MSG_CHECKING([for selinux support])
|
|
AC_MSG_RESULT([no])
|
|
])
|
|
])
|