From 66e4cb6a6e13e1d03632cb447edbcddd0d7b6c98 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 16 Oct 2026 11:18:31 -0300 Subject: [PATCH] fix(xcat-core): restorecon relabels a rootimg outside the default path xcat.fc excluded a rootimg from the /install relabel only at /install/netboot////rootimg. An osimage whose rootimgdir has another depth got public_content_t on every guest file, so installing or upgrading xCAT-selinux overwrote the labels of the guest operating system. genimage, packimage and statelite put the tree at /rootimg. The two <> entries now match a rootimg or rootimg-statelite path component at any depth under /install. The published files beside the tree, such as kernel, the initrds and rootimg.cpio.gz, keep public_content_t. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-selinux/xcat.fc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-selinux/xcat.fc b/xCAT-selinux/xcat.fc index d69e58c9a5..9b24c4bdb3 100644 --- a/xCAT-selinux/xcat.fc +++ b/xCAT-selinux/xcat.fc @@ -16,5 +16,7 @@ /install(/.*)? gen_context(system_u:object_r:public_content_t,s0) # A rootimg keeps the labels of its own OS, so restorecon must not change them. -/install/netboot/[^/]+/[^/]+/[^/]+/rootimg(/.*)? <> -/install/netboot/[^/]+/[^/]+/[^/]+/rootimg-statelite(/.*)? <> +# genimage puts the tree at /rootimg, and rootimgdir can be at any +# depth under /install. +/install(/.*)?/rootimg(/.*)? <> +/install(/.*)?/rootimg-statelite(/.*)? <>