From 4e35eebfbdae3ee8a5bb718a5b88e291334f820f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 15 Oct 2026 15:15:39 -0300 Subject: [PATCH] fix(xcat-core): the policy package does not repair a stale label %posttrans relabelled /install only. A path under /opt/xcat whose context was wrong before the package arrived kept it, because rpm does not relabel a directory that already exists and nothing else ran restorecon there. %posttrans now relabels /opt/xcat too, so installing or updating the policy brings the product tree to the contexts the module declares. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-selinux/xCAT-selinux.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-selinux/xCAT-selinux.spec b/xCAT-selinux/xCAT-selinux.spec index 9751811c2d..9db0e8287b 100644 --- a/xCAT-selinux/xCAT-selinux.spec +++ b/xCAT-selinux/xCAT-selinux.spec @@ -65,3 +65,8 @@ fi if selinuxenabled && [ -d /install ]; then restorecon -R /install || : fi +# An upgrade does not relabel a directory that already exists, so a path whose +# label predates its packaging keeps it. Relabel the product tree as well. +if selinuxenabled && [ -d /opt/xcat ]; then + restorecon -R /opt/xcat || : +fi