Bug 2069305
Summary: | restorecon fails to apply to user ssh directory after creating key | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Achilleas Koutsou <akoutsou> | |
Component: | anaconda | Assignee: | Vladimír Slávik <vslavik> | |
Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 8.6 | CC: | akoutsou, jkonecny, jstodola, pzatko, rvykydal, vslavik | |
Target Milestone: | rc | Keywords: | TestCaseNeeded, Triaged | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | anaconda-33.16.7.2-1.el8 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2072426 (view as bug list) | Environment: | ||
Last Closed: | 2022-11-08 09:17:27 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Achilleas Koutsou
2022-03-28 16:49:43 UTC
We should make sure that we are running restorecon always in the chroot. So, this is in set_user_ssh_key() and create_user() on rhel-8, or set_user_ssh_key() and _reown_homedir() on master. We do util.execWithRedirect("restorecon", ["-r", <something>]), which is wrong. Looks like it was originally added with 911f99f834eb31cc2fbbcb23c2cb40d05a68c610 and the other place with 5e238e89882171e66c43be1bdc16d5a9183f585b in response to bug 1087736. Apparently nobody ever noticed that this does not work, or that it stopped working somewhere along the way. We just refactored it a few times since then... It looks like these things run when creating users, which is after payload installation, so simply adding the sysroot parameter to the calls should be enough. Upstream PR: https://github.com/rhinstaller/anaconda/pull/3993 A note about RHEL 9.0: The bug in Anaconda also exists in RHEL 9.0, the restorecon run uses the full path and not a chroot so the call has no effect. However, the way it doesn't cause the issue I saw because useradd labels the home directory correctly. There may be other scenarios where the failure to relabel does cause problems though. Checked that anaconda-33.16.7.2-1.el8 is in nightly compose RHEL-8.7.0-20220526.1 Moving to VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (anaconda bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:7462 |