mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-19 17:02:15 +00:00
6f578741af
The file contexts leave the published kernel of a middle-rootimg image root out of the relabel. The comment and the SELinux page read that as the kernel being unlabeled, httpd refusing to serve it, and that osimage losing netboot, with restorecon as the repair. Three of those four claims are wrong. Measured. An entry of <<none>> keeps the label a path has: restorecon -R, restorecon -RF and setfiles -F all left a kernel at default_t, while the same setfiles call relabeled a path that has a rule. A new file inherits the type of its directory, so a kernel that genimage writes into an image root already made public_content_t is public_content_t. In the policy with the xcat module loaded, httpd_t holds one allow rule to read public_content_t and none for default_t. So the ordinary case serves and netboot works, and restorecon is not the repair for the case that does not: chcon -R -t public_content_t over the image root is, and a later relabel leaves that value alone. selinux_file_contexts.t now starts half the custom roots at public_content_t, which is what genimage produces, and half at default_t, and requires each to keep its own type. It fails 324 of its 618 checks against the previous xcat.fc. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>