[libvirt PATCH 15/31] m4: virt-selinux: drop check for selabel_open signature change

Pavel Hrdina phrdina at redhat.com
Thu Jul 2 12:25:13 UTC 2020


All supported OSes have at least libselinux version 2.5 so it's safe
to drop this check.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 m4/virt-selinux.m4            | 17 -----------------
 tests/securityselinuxhelper.c |  5 ++---
 2 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4
index 64e69808440..fb541e207ed 100644
--- a/m4/virt-selinux.m4
+++ b/m4/virt-selinux.m4
@@ -27,23 +27,6 @@ AC_DEFUN([LIBVIRT_CHECK_SELINUX],[
                     [fgetfilecon_raw], [selinux/selinux.h])
 
   if test "$with_selinux" = "yes"; then
-    # libselinux changed signatures for 2.5
-    # TODO: Drop once we don't support Ubuntu 16.04
-    AC_CACHE_CHECK([for selinux selabel_open parameter type],
-                   [lv_cv_selabel_open_const],
-    [AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-         [[
-#include <selinux/selinux.h>
-#include <selinux/label.h>
-struct selabel_handle *selabel_open(unsigned, struct selinux_opt *, unsigned);
-         ]])],
-         [lv_cv_selabel_open_const=''],
-         [lv_cv_selabel_open_const='const'])])
-    AC_DEFINE_UNQUOTED([VIR_SELINUX_OPEN_CONST], [$lv_cv_selabel_open_const],
-      [Define to empty or 'const' depending on how SELinux qualifies its
-       selabel_open parameter])
-
     AC_MSG_CHECKING([SELinux mount point])
     if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then
       if test -d /sys/fs/selinux ; then
diff --git a/tests/securityselinuxhelper.c b/tests/securityselinuxhelper.c
index f89224c07a4..0556241fd55 100644
--- a/tests/securityselinuxhelper.c
+++ b/tests/securityselinuxhelper.c
@@ -53,8 +53,7 @@ static const char *(*real_selinux_lxc_contexts_path)(void);
 #endif
 
 static struct selabel_handle *(*real_selabel_open)(unsigned int backend,
-                                                  VIR_SELINUX_OPEN_CONST
-                                                  struct selinux_opt *opts,
+                                                  const struct selinux_opt *opts,
                                                   unsigned nopts);
 static void (*real_selabel_close)(struct selabel_handle *handle);
 static int (*real_selabel_lookup_raw)(struct selabel_handle *handle,
@@ -288,7 +287,7 @@ const char *selinux_lxc_contexts_path(void)
 
 struct selabel_handle *
 selabel_open(unsigned int backend,
-             VIR_SELINUX_OPEN_CONST struct selinux_opt *opts,
+             const struct selinux_opt *opts,
              unsigned nopts)
 {
     char *fake_handle;
-- 
2.26.2




More information about the libvir-list mailing list