]> err.no Git - util-linux/commitdiff
mount: fix undefined reference to `security_get_initial_context'
authorKarel Zak <kzak@redhat.com>
Thu, 21 May 2009 11:20:10 +0000 (13:20 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 May 2009 11:20:10 +0000 (13:20 +0200)
> Gentoo-hardened stable have: sys-libs/libselinux-1.34.14
> I have:
> mount.c:(.text+0x12ce): undefined reference to `security_get_initial_context'

Reported-by: Максим Бритов <maxim.britov@gmail.com>
Addresses-Gentoo-Bug: #270168
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
mount/mount.c

index af946a15f6ed3432715c6425f575c20357fd1970..b174bce2b9f30dd99b8c675c99031852d66b5416 100644 (file)
@@ -656,6 +656,11 @@ fi
 if test "x$have_selinux" = xyes; then
   SELINUX_LIBS="-lselinux -lsepol"
   SELINUX_LIBS_STATIC="-lselinux -lsepol"
+  old_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $SELINUX_LIBS"
+  # This function is missing in old libselinux 1.xx versions
+  AC_CHECK_FUNCS([security_get_initial_context])
+  LDFLAGS="$old_LDFLAGS"
 fi
 AC_SUBST([SELINUX_LIBS])
 AC_SUBST([SELINUX_LIBS_STATIC])
index f48f9d408dd1a358dded0d4e9fa0b4ccf2762257..cc5b88ae53296c9d7f217f75799e7b9733ec2ee7 100644 (file)
@@ -1561,7 +1561,7 @@ mount_retry:
 
  out:
 
-#ifdef HAVE_LIBSELINUX
+#if defined(HAVE_LIBSELINUX) && defined(HAVE_SECURITY_GET_INITIAL_CONTEXT)
   if (res != EX_FAIL && verbose && is_selinux_enabled() > 0) {
       security_context_t raw = NULL, def = NULL;