Richard W.M. Jones
2023-Apr-03 09:16 UTC
[Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel
SFDC case 03473932, RHEL 8 only.
See discussion in private email thread "Customer case requiring our
assistance" in 2023.
---
mlcustomize/SELinux_relabel.ml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mlcustomize/SELinux_relabel.ml b/mlcustomize/SELinux_relabel.ml
index 5ecf7bd..f0630db 100644
--- a/mlcustomize/SELinux_relabel.ml
+++ b/mlcustomize/SELinux_relabel.ml
@@ -35,11 +35,12 @@ let rec relabel (g : G.guestfs) use_setfiles g;
(* That worked, so we don't need to autorelabel. *)
g#rm_f "/.autorelabel"
- with Failure _ ->
+ with Failure _
(* This is the fallback in case something in the setfiles
* method didn't work. That includes the case where a non-SELinux
* host is processing an SELinux guest, and other things.
*)
+ | Guestfs.Error _ -> (* this is for SFDC case 03473932 in RHEL 8 only *)
g#touch "/.autorelabel"
)
--
2.39.1
Laszlo Ersek
2023-Apr-03 09:45 UTC
[Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel
On 4/3/23 11:16, Richard W.M. Jones wrote:> SFDC case 03473932, RHEL 8 only. > > See discussion in private email thread "Customer case requiring our > assistance" in 2023. > --- > mlcustomize/SELinux_relabel.ml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mlcustomize/SELinux_relabel.ml b/mlcustomize/SELinux_relabel.ml > index 5ecf7bd..f0630db 100644 > --- a/mlcustomize/SELinux_relabel.ml > +++ b/mlcustomize/SELinux_relabel.ml > @@ -35,11 +35,12 @@ let rec relabel (g : G.guestfs) > use_setfiles g; > (* That worked, so we don't need to autorelabel. *) > g#rm_f "/.autorelabel" > - with Failure _ -> > + with Failure _ > (* This is the fallback in case something in the setfiles > * method didn't work. That includes the case where a non-SELinux > * host is processing an SELinux guest, and other things. > *) > + | Guestfs.Error _ -> (* this is for SFDC case 03473932 in RHEL 8 only *) > g#touch "/.autorelabel" > ) >Reviewed-by: Laszlo Ersek <lersek at redhat.com>
Laszlo Ersek
2023-Apr-03 10:00 UTC
[Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel
On 4/3/23 11:16, Richard W.M. Jones wrote:> SFDC case 03473932, RHEL 8 only. > > See discussion in private email thread "Customer case requiring our > assistance" in 2023. > --- > mlcustomize/SELinux_relabel.ml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mlcustomize/SELinux_relabel.ml b/mlcustomize/SELinux_relabel.ml > index 5ecf7bd..f0630db 100644 > --- a/mlcustomize/SELinux_relabel.ml > +++ b/mlcustomize/SELinux_relabel.ml > @@ -35,11 +35,12 @@ let rec relabel (g : G.guestfs) > use_setfiles g; > (* That worked, so we don't need to autorelabel. *) > g#rm_f "/.autorelabel" > - with Failure _ -> > + with Failure _ > (* This is the fallback in case something in the setfiles > * method didn't work. That includes the case where a non-SELinux > * host is processing an SELinux guest, and other things. > *) > + | Guestfs.Error _ -> (* this is for SFDC case 03473932 in RHEL 8 only *) > g#touch "/.autorelabel" > ) >Will we create a new rhel-8.xxx branch (in the upstream repo of course) for this? Thanks Laszlo