2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 17:32:15 +00:00
Files
xcat-core/xCAT-server
Daniel Hilst 16e20fbb52 fix(xcat-core): Genesis kernel keeps the install tree SELinux context
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>
2026-10-14 16:45:21 -03:00
..
2016-07-21 13:27:40 -04:00