From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 3679D5A0281; Thu, 22 May 2025 23:13:31 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] fedora: Separately restore context for /run/user in %posttrans selinux Date: Thu, 22 May 2025 23:13:31 +0200 Message-ID: <20250522211331.3904674-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: BRRZ475YCEXXVARQ2PDVNGNXUM3MOXBJ X-Message-ID-Hash: BRRZ475YCEXXVARQ2PDVNGNXUM3MOXBJ X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Max Chernoff , Paul Holzinger X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The previous change introduces specific file contexts for /run/user/%{USERID}/netns and /run/user/%{USERID}/containers/networks/rootless-netns, but %selinux_relabel_post can't handle that, see comments for more details. Add a separate restorecon(8) call for /run/user in the post-transaction scriptlet for the SELinux subpackage. Reported-by: Max Chernoff Link: https://bugs.passt.top/show_bug.cgi?id=81 Link: https://github.com/containers/podman/discussions/26100#discussioncomment-13088518 Signed-off-by: Stefano Brivio --- This should be applied on top of Max's: [PATCH v3 1/1] selinux: Transition to pasta_t in containers contrib/fedora/passt.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/fedora/passt.spec b/contrib/fedora/passt.spec index 745cf01..5aaf7ac 100644 --- a/contrib/fedora/passt.spec +++ b/contrib/fedora/passt.spec @@ -102,6 +102,12 @@ fi %posttrans selinux %selinux_relabel_post -s %{selinuxtype} +# %selinux_relabel_post calls fixfiles(8) with the previous file_contexts file +# (see selabel_file(5)) in order to restore only the file contexts which +# actually changed. However, as file_contexts doesn't support %{USERID} +# substitutions, this will not work for specific file contexts that pasta needs +# to have under /run/user. Restore those explicitly. +restorecon -R /run/user %files %license LICENSES/{GPL-2.0-or-later.txt,BSD-3-Clause.txt} -- 2.43.0