diff --git a/libselinux-build-fix.patch b/libselinux-build-fix.patch new file mode 100644 index 0000000..df2c37c --- /dev/null +++ b/libselinux-build-fix.patch @@ -0,0 +1,79 @@ +diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 +index 003c2a8..d1f0347 100644 +--- a/m4/virt-selinux.m4 ++++ b/m4/virt-selinux.m4 +@@ -28,6 +28,24 @@ AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ + [with_selinux_mount=check]) + + if test "$with_selinux" = "yes"; then ++ AC_CACHE_CHECK([for selinux setcon parameter type], [gt_cv_setcon_param], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[ ++#include ++ ++int setcon(const security_context_t context) { ++ return 0; ++} ++ ]], ++ [[]])], ++ [gt_cv_setcon_param='security_context'], ++ [gt_cv_setcon_param='const char*'])]) ++ if test "$gt_cv_setcon_param" = 'const char*'; then ++ AC_DEFINE_UNQUOTED([SELINUX_CTX_CHAR_PTR], 1, ++ [SELinux uses char * for security context]) ++ fi ++ + 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 dbc4c29..af4fae4 100644 +--- a/tests/securityselinuxhelper.c ++++ b/tests/securityselinuxhelper.c +@@ -156,7 +156,11 @@ int getpidcon(pid_t pid, security_context_t *context) + return getpidcon_raw(pid, context); + } + ++#ifdef SELINUX_CTX_CHAR_PTR ++int setcon_raw(const char *context) ++#else + int setcon_raw(security_context_t context) ++#endif + { + if (!is_selinux_enabled()) { + errno = EINVAL; +@@ -165,13 +169,21 @@ int setcon_raw(security_context_t context) + return setenv("FAKE_SELINUX_CONTEXT", context, 1); + } + ++#ifdef SELINUX_CTX_CHAR_PTR ++int setcon(const char *context) ++#else + int setcon(security_context_t context) ++#endif + { + return setcon_raw(context); + } + + ++#ifdef SELINUX_CTX_CHAR_PTR ++int setfilecon_raw(const char *path, const char *con) ++#else + int setfilecon_raw(const char *path, security_context_t con) ++#endif + { + const char *constr = con; + if (STRPREFIX(path, abs_builddir "/securityselinuxlabeldata/nfs/")) { +@@ -182,7 +194,11 @@ int setfilecon_raw(const char *path, security_context_t con) + constr, strlen(constr), 0); + } + ++#ifdef SELINUX_CTX_CHAR_PTR ++int setfilecon(const char *path, const char *con) ++#else + int setfilecon(const char *path, security_context_t con) ++#endif + { + return setfilecon_raw(path, con); + } diff --git a/libvirt.changes b/libvirt.changes index 588b312..45c1552 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 28 12:42:34 UTC 2014 - cbosdonnat@suse.com + +- Fix the build breakers brought by libselinux 2.3. + libselinux-build-fix.patch + ------------------------------------------------------------------- Tue May 20 15:13:22 MDT 2014 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 4dc29eb..499a639 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -439,6 +439,7 @@ Patch100: xen-name-for-devid.patch Patch101: ia64-clone.patch Patch102: xen-pv-cdrom.patch Patch103: add-nocow-to-vol-xml.patch +Patch104: libselinux-build-fix.patch # pending review upstream patches Patch150: libxl-migration-support.patch # Our patches @@ -962,6 +963,7 @@ namespaces. %patch101 -p1 %patch102 -p1 %patch103 -p1 +%patch104 -p1 %patch150 -p1 %patch200 -p1 %patch201 -p1