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