strace/SOURCES/0155-m4-mpers.m4-generate-HAVE_-_SELINUX_RUNTIME-config-d.patch
2021-09-22 09:09:53 +00:00

87 lines
2.8 KiB
Diff

From bbe5eefaa928449de5994c5288a7c85fae54f716 Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Sat, 31 Jul 2021 15:17:41 +0200
Subject: [PATCH] m4/mpers.m4: generate HAVE_*_SELINUX_RUNTIME config defines
While bootstrap has some provisions for mangling HAVE_SELINUX_RUNTIME
into HAVE_{M32,MX32}_SELINUX_RUNTIME, and there is logic for checking
SELinux runtime presence in non-native personalities, the relevant
configuration definition is not ultimately generated, as it has to be
defined explicitly, similarly to HAVE_*_MPERS.
* m4/mpers.m4 (st_MPERS) [$st_cv_selinux_runtime == yes]: AC_DEFINE
HAVE_SELINUX_RUNTIME.
Complements: v5.12~49 "Implement --secontext[=full] option to display SELinux contexts"
---
m4/mpers.m4 | 4 ++++
1 file changed, 4 insertions(+)
Index: strace-5.7/m4/mpers.m4
===================================================================
--- strace-5.7.orig/m4/mpers.m4 2021-08-24 21:08:43.252246052 +0200
+++ strace-5.7/m4/mpers.m4 2021-08-24 21:26:07.436408149 +0200
@@ -179,6 +179,10 @@
popdef([SIZEOF_STRUCT_MSQID64_DS])
fi
fi
+ if test "x$st_cv_selinux_runtime" = xyes; then
+ AC_DEFINE([HAVE_SELINUX_RUNTIME], [1],
+ [Define to enable SELinux security contexts testing for ]mpers_name[ personality])
+ fi
fi
CPPFLAGS="$saved_CPPFLAGS"
CFLAGS="$saved_CFLAGS"
Index: strace-5.7/config.h.in
===================================================================
--- strace-5.7.orig/config.h.in 2021-08-24 21:08:43.304245612 +0200
+++ strace-5.7/config.h.in 2021-08-24 21:26:07.437408141 +0200
@@ -2181,6 +2181,9 @@
/* Define to 1 if you have mpers_name mpers support */
#undef HAVE_M32_MPERS
+/* Define to enable SELinux security contexts testing for m32 personality */
+#undef HAVE_M32_SELINUX_RUNTIME
+
/* Define to 1 if m32 has the type 'struct stat'. */
#undef HAVE_M32_STRUCT_STAT
@@ -2202,6 +2205,9 @@
/* Define to 1 if you have mpers_name mpers support */
#undef HAVE_MX32_MPERS
+/* Define to enable SELinux security contexts testing for mx32 personality */
+#undef HAVE_MX32_SELINUX_RUNTIME
+
/* Define to 1 if mx32 has the type 'struct stat'. */
#undef HAVE_MX32_STRUCT_STAT
Index: strace-5.7/configure
===================================================================
--- strace-5.7.orig/configure 2021-08-24 21:08:43.315245519 +0200
+++ strace-5.7/configure 2021-08-24 21:26:07.439408124 +0200
@@ -23632,6 +23632,11 @@
fi
fi
+ if test "x$st_cv_m32_selinux_runtime" = xyes; then
+
+$as_echo "#define HAVE_M32_SELINUX_RUNTIME 1" >>confdefs.h
+
+ fi
fi
CPPFLAGS="$saved_CPPFLAGS"
CFLAGS="$saved_CFLAGS"
@@ -24314,6 +24319,11 @@
fi
fi
+ if test "x$st_cv_mx32_selinux_runtime" = xyes; then
+
+$as_echo "#define HAVE_MX32_SELINUX_RUNTIME 1" >>confdefs.h
+
+ fi
fi
CPPFLAGS="$saved_CPPFLAGS"
CFLAGS="$saved_CFLAGS"