Blame SOURCES/0155-m4-mpers.m4-generate-HAVE_-_SELINUX_RUNTIME-config-d.patch

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