mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-20 17:32:15 +00:00
16e20fbb52
mknb stages the legacy Genesis kernel with cp -a, which implies --preserve=all and copies the SELinux context of /opt/xcat/share/xcat/netboot/genesis with it. On a management node with SELinux enabled the kernel then carries usr_t, while the policy declares tftpdir_t for that path. Measured on an el9 management node, restorecon -nvR /tftpboot names genesis.kernel.x86_64 and no other path, so it is the one file xCAT mislabels under the TFTP root. Nothing in the netboot path relabels it. stage_genesis_payload now copies with --no-preserve=context,xattr, and runs restorecon -F on the staged kernel when xCAT::Utils->isSELINUX reports SELinux enabled. xattr goes with context because cp stores the context in the security.selinux xattr, so --no-preserve=context alone still copies it. The relabel corrects a kernel that an earlier xCAT staged, because a copy over an existing file keeps that file's context. A failed relabel does not fail the step. mknb_genesis_staging.t reports SELinux as disabled, so its command counts stay about the copies it tests. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>