Blame SOURCES/0008-generator-customize-invert-SELinux-relabeling-defaul.patch

65aaff
From 8f800b369ada05ea690cebb0bb5e0fed0ba1c548 Mon Sep 17 00:00:00 2001
65aaff
From: Laszlo Ersek <lersek@redhat.com>
65aaff
Date: Tue, 10 May 2022 12:27:57 +0200
65aaff
Subject: [PATCH] generator/customize: invert SELinux relabeling default
65aaff
65aaff
Replace the "--selinux-relabel" option with "--no-selinux-relabel",
65aaff
inverting the default behavior (for guests with SELinux support, that is
65aaff
-- relabeling is always skipped for guests that don't support SELinux.)
65aaff
65aaff
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1554735
65aaff
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2075718
65aaff
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
65aaff
Message-Id: <20220510102757.14466-3-lersek@redhat.com>
65aaff
Acked-by: Richard W.M. Jones <rjones@redhat.com>
65aaff
(cherry picked from commit 2f6a27f1077d32d1ab526427052fc88e188356f7)
65aaff
---
65aaff
 generator/customize.ml | 19 +++++++++++--------
65aaff
 1 file changed, 11 insertions(+), 8 deletions(-)
65aaff
65aaff
diff --git a/generator/customize.ml b/generator/customize.ml
65aaff
index 3b3eec6d2..9634dad85 100644
65aaff
--- a/generator/customize.ml
65aaff
+++ b/generator/customize.ml
65aaff
@@ -564,18 +564,21 @@ to modify C</etc/sysconfig/authconfig> (Fedora, RHEL) or
65aaff
 C</etc/pam.d/common-password> (Debian, Ubuntu).";
65aaff
   };
65aaff
 
65aaff
-  { flag_name = "selinux-relabel";
65aaff
+  { flag_name = "no-selinux-relabel";
65aaff
     flag_type = FlagBool false (* XXX - the default in virt-builder *);
65aaff
-    flag_ml_var = "selinux_relabel";
65aaff
-    flag_shortdesc = "Relabel files with correct SELinux labels";
65aaff
+    flag_ml_var = "no_selinux_relabel";
65aaff
+    flag_shortdesc = "Do not relabel files with correct SELinux labels";
65aaff
     flag_pod_longdesc = "\
65aaff
-Relabel files in the guest so that they have the correct SELinux label.
65aaff
+Do not attempt to correct the SELinux labels of files in the guest.
65aaff
 
65aaff
-This will attempt to relabel files immediately, but if the operation fails
65aaff
-this will instead touch F</.autorelabel> on the image to schedule a
65aaff
-relabel operation for the next time the image boots.
65aaff
+In such guests that support SELinux, customization automatically
65aaff
+relabels files so that they have the correct SELinux label.  (The
65aaff
+relabeling is performed immediately, but if the operation fails,
65aaff
+customization will instead touch F</.autorelabel> on the image to
65aaff
+schedule a relabel operation for the next time the image boots.)  This
65aaff
+option disables the automatic relabeling.
65aaff
 
65aaff
-This option is a no-op for guests that do not support SELinux.";
65aaff
+The option is a no-op for guests that do not support SELinux.";
65aaff
   };
65aaff
 
65aaff
   { flag_name = "sm-credentials";
65aaff
-- 
65aaff
2.31.1
65aaff