From 45ebeacab8b1760b295b5d3ca4e8cf0267d64259 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 21 Oct 2026 19:53:51 -0300 Subject: [PATCH] docs(selinux): the page says a path left out of the relabel is unlabeled A file context of <> stops restorecon changing the label. It does not clear it. A tree that genimage creates under an image root that is already public_content_t inherits that type, measured on an enforcing el10 host: mkdir -p rootimg/common/sub under a public_content_t parent gives every new component public_content_t, and the same tree under a default_t parent gives default_t. Say what the label is, and name the case that costs something: a tree older than the package keeps default_t, and restorecon -RF over the image root sets it. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- docs/source/advanced/selinux/index.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/source/advanced/selinux/index.rst b/docs/source/advanced/selinux/index.rst index 9aaf9877cc..f9d7362909 100644 --- a/docs/source/advanced/selinux/index.rst +++ b/docs/source/advanced/selinux/index.rst @@ -78,9 +78,15 @@ labels there, so an osimage whose ``rootimgdir`` has a directory called and ``httpd`` cannot serve them. Give such an osimage a ``rootimgdir`` with no ``rootimg`` component, or run ``restorecon`` over the image root after the package is installed. A published ``common`` or ``overlay`` directory of an -image root called ``rootimg`` is unlabeled for the same reason: its path is -also the path of a ``common`` or ``overlay`` directory at the root of a guest -tree. +image root called ``rootimg`` is left out for the same reason: its path is also +the path of a ``common`` or ``overlay`` directory at the root of a guest tree. + +A path the file contexts leave out keeps the label it has. ``restorecon`` does +not change it and does not clear it. A tree that ``genimage`` creates under an +image root that is already ``public_content_t`` inherits that type, so the two +directories above cost nothing in that case. A tree that is older than the +package keeps ``default_t``, and ``restorecon -RF`` over the image root sets +it. The unit holds ``/opt/xcat`` as the default prefix, and ``%post`` writes ``/etc/xcat/xcatroot.env`` with the prefix of the installation, which the unit