Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Upon patching systemd-libs-239-51.el8_5.5.x86_64 edits nssswitch.conf which is complied from a custom profile in authselect.
Version-Release number of selected component (if applicable):
systemd-libs-239-51.el8_5.5.x86_64
How reproducible:
Consistantly
Steps to Reproduce:
1. Patch system that is using a customer authselect profile with nssswitch.conf.
Actual results:
systemd gets added to /etc/nssswitch.conf passwd and group.
Expected results:
No change to /etc/nssswitch.conf
Additional info:
# rpm -q --scripts systemd-libs-239-51.el8_5.5.x86_64
This produces the following:
postinstall scriptlet (using /bin/sh):
function mod_nss() {
if [ -f "$1" ] ; then
# sed-fu to add myhostanme to hosts line
grep -E -q '^hosts:.* myhostname' "$1" ||
sed -i.bak -e '
/^hosts:/ !b
/\<myhostname\>/ b
s/[[:blank:]]*$/ myhostname/
' "$1" &>/dev/null || :
# Add nss-systemd to passwd and group
grep -E -q '^(passwd|group):.* systemd' "$1" ||
sed -i.bak -r -e '
s/^(passwd|group):(.*)/\1: \2 systemd/
' "$1" &>/dev/null || :
fi
}
FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)"
mod_nss "$FILE"
if [ "$FILE" = "/etc/authselect/user-nsswitch.conf" ] ; then
authselect apply-changes &> /dev/null
else
# also apply the same changes to nsswitch.conf to affect
# possible future authselect configuration
mod_nss "/etc/authselect/user-nsswitch.conf"
fi
# check if nobody or nfsnobody is defined
export SYSTEMD_NSS_BYPASS_SYNTHETIC=1
if getent passwd nfsnobody &>/dev/null; then
test -f /etc/systemd/dont-synthesize-nobody || {
echo 'Detected system with nfsnobody defined, creating /etc/systemd/dont-synthesize-nobody'
mkdir -p /etc/systemd || :
: >/etc/systemd/dont-synthesize-nobody || :
}
elif getent passwd nobody 2>/dev/null | grep -v 'nobody:[x*]:65534:65534:.*:/:/sbin/nologin' &>/dev/null; then
test -f /etc/systemd/dont-synthesize-nobody || {
echo 'Detected system with incompatible nobody defined, creating /etc/systemd/dont-synthesize-nobody'
mkdir -p /etc/systemd || :
: >/etc/systemd/dont-synthesize-nobody || :
}
fi
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 (systemd 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:7727
Description of problem: Upon patching systemd-libs-239-51.el8_5.5.x86_64 edits nssswitch.conf which is complied from a custom profile in authselect. Version-Release number of selected component (if applicable): systemd-libs-239-51.el8_5.5.x86_64 How reproducible: Consistantly Steps to Reproduce: 1. Patch system that is using a customer authselect profile with nssswitch.conf. Actual results: systemd gets added to /etc/nssswitch.conf passwd and group. Expected results: No change to /etc/nssswitch.conf Additional info: # rpm -q --scripts systemd-libs-239-51.el8_5.5.x86_64 This produces the following: postinstall scriptlet (using /bin/sh): function mod_nss() { if [ -f "$1" ] ; then # sed-fu to add myhostanme to hosts line grep -E -q '^hosts:.* myhostname' "$1" || sed -i.bak -e ' /^hosts:/ !b /\<myhostname\>/ b s/[[:blank:]]*$/ myhostname/ ' "$1" &>/dev/null || : # Add nss-systemd to passwd and group grep -E -q '^(passwd|group):.* systemd' "$1" || sed -i.bak -r -e ' s/^(passwd|group):(.*)/\1: \2 systemd/ ' "$1" &>/dev/null || : fi } FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)" mod_nss "$FILE" if [ "$FILE" = "/etc/authselect/user-nsswitch.conf" ] ; then authselect apply-changes &> /dev/null else # also apply the same changes to nsswitch.conf to affect # possible future authselect configuration mod_nss "/etc/authselect/user-nsswitch.conf" fi # check if nobody or nfsnobody is defined export SYSTEMD_NSS_BYPASS_SYNTHETIC=1 if getent passwd nfsnobody &>/dev/null; then test -f /etc/systemd/dont-synthesize-nobody || { echo 'Detected system with nfsnobody defined, creating /etc/systemd/dont-synthesize-nobody' mkdir -p /etc/systemd || : : >/etc/systemd/dont-synthesize-nobody || : } elif getent passwd nobody 2>/dev/null | grep -v 'nobody:[x*]:65534:65534:.*:/:/sbin/nologin' &>/dev/null; then test -f /etc/systemd/dont-synthesize-nobody || { echo 'Detected system with incompatible nobody defined, creating /etc/systemd/dont-synthesize-nobody' mkdir -p /etc/systemd || : : >/etc/systemd/dont-synthesize-nobody || : } fi