Blame SOURCES/0053-RHEL-8-If-setfiles-fails-fall-back-to-autorelabel.patch

15d06e
From 217a74ad09bad781ee9efd5599f4323bdf9e3cff Mon Sep 17 00:00:00 2001
15d06e
From: "Richard W.M. Jones" <rjones@redhat.com>
15d06e
Date: Mon, 3 Apr 2023 09:41:37 +0100
15d06e
Subject: [PATCH] RHEL 8: If setfiles fails fall back to autorelabel
15d06e
15d06e
SFDC case 03473932, RHEL 8 only.
15d06e
15d06e
See discussion in private email thread "Customer case requiring our
15d06e
assistance" in 2023.
15d06e
---
15d06e
 common | 2 +-
15d06e
 1 file changed, 1 insertion(+), 1 deletion(-)
15d06e
15d06e
Submodule common 1174b443..c4841a70:
15d06e
diff --git a/common/mlcustomize/SELinux_relabel.ml b/common/mlcustomize/SELinux_relabel.ml
15d06e
index 5ecf7bd7..f0630db1 100644
15d06e
--- a/common/mlcustomize/SELinux_relabel.ml
15d06e
+++ b/common/mlcustomize/SELinux_relabel.ml
15d06e
@@ -35,11 +35,12 @@ let rec relabel (g : G.guestfs) =
15d06e
       use_setfiles g;
15d06e
       (* That worked, so we don't need to autorelabel. *)
15d06e
       g#rm_f "/.autorelabel"
15d06e
-    with Failure _ ->
15d06e
+    with Failure _
15d06e
       (* This is the fallback in case something in the setfiles
15d06e
        * method didn't work.  That includes the case where a non-SELinux
15d06e
        * host is processing an SELinux guest, and other things.
15d06e
        *)
15d06e
+    | Guestfs.Error _ -> (* this is for SFDC case 03473932 in RHEL 8 only *)
15d06e
       g#touch "/.autorelabel"
15d06e
   )
15d06e