2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-25 20:02:19 +00:00

fix(xcat-core): restorecon relabels a rootimg outside the default path

xcat.fc excluded a rootimg from the /install relabel only at
/install/netboot/<os>/<arch>/<profile>/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 <rootimgdir>/rootimg.
The two <<none>> 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>
This commit is contained in:
Daniel Hilst
2026-10-16 11:18:31 -03:00
parent 905c63e47c
commit 66e4cb6a6e
+4 -2
View File
@@ -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(/.*)? <<none>>
/install/netboot/[^/]+/[^/]+/[^/]+/rootimg-statelite(/.*)? <<none>>
# genimage puts the tree at <rootimgdir>/rootimg, and rootimgdir can be at any
# depth under /install.
/install(/.*)?/rootimg(/.*)? <<none>>
/install(/.*)?/rootimg-statelite(/.*)? <<none>>