Bug 2038811

Summary: shadow-utils: Crash in libsubid nss_init if /etc/nsswitch.conf is missing
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: shadow-utilsAssignee: Iker Pedrosa <ipedrosa>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 35CC: ipedrosa, pvrabec, tm
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: shadow-utils-4.9-9.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-23 01:42:20 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 Florian Weimer 2022-01-10 07:49:00 UTC
If there is no /etc/nsswitch.conf file, podman crashes. This is because shadow_logfd is NULL on line 59:

55		// read nsswitch.conf to check for a line like:
56		//   subid:	files
57		nssfp = fopen(nsswitch_path, "r");
58		if (!nssfp) {
59			fprintf(shadow_logfd, "Failed opening %s: %m", nsswitch_path);
60			atomic_store(&nss_init_completed, true);
61			return;
62		}

Seen with shadow-utils-4.9-8.fc35.x86_64.

Comment 1 Iker Pedrosa 2022-01-10 08:47:43 UTC
Can you provide the steps to reproduce the problem? I'm not a podman expert and so far I haven't been able to reproduce it.

By the way, I think that upstream already solved this problem in https://github.com/shadow-maint/shadow/pull/474.

Comment 2 Florian Weimer 2022-01-10 08:51:45 UTC
For me, “podman pull fedora” or “podman system reset” crash.

Comment 3 Fedora Update System 2022-01-21 09:40:26 UTC
FEDORA-2022-8e62470e3e has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8e62470e3e

Comment 4 Fedora Update System 2022-01-22 02:08:24 UTC
FEDORA-2022-8e62470e3e has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-8e62470e3e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-8e62470e3e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2022-01-23 01:42:20 UTC
FEDORA-2022-8e62470e3e has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.