dnl The libselinux.so library
dnl
-dnl Copyright (C) 2012-2014 Red Hat, Inc.
+dnl Copyright (C) 2012-2014, 2016 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
AC_DEFINE_UNQUOTED([VIR_SELINUX_CTX_CONST], [$lv_cv_setcon_const],
[Define to empty or 'const' depending on how SELinux qualifies its
security context parameters])
+ # ...and again for 2.5
+ 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
/*
- * Copyright (C) 2011-2013 Red Hat, Inc.
+ * Copyright (C) 2011-2013, 2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#if HAVE_SELINUX_LABEL_H
static struct selabel_handle *(*realselabel_open)(unsigned int backend,
+ VIR_SELINUX_OPEN_CONST
struct selinux_opt *opts,
unsigned nopts);
static void (*realselabel_close)(struct selabel_handle *handle);
#endif
#if HAVE_SELINUX_LABEL_H
-struct selabel_handle *selabel_open(unsigned int backend,
- struct selinux_opt *opts,
- unsigned nopts)
+struct selabel_handle *
+selabel_open(unsigned int backend,
+ VIR_SELINUX_OPEN_CONST struct selinux_opt *opts,
+ unsigned nopts)
{
char *fake_handle;