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

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