Bug 2038811 - shadow-utils: Crash in libsubid nss_init if /etc/nsswitch.conf is missing
Summary: shadow-utils: Crash in libsubid nss_init if /etc/nsswitch.conf is missing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 35
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Iker Pedrosa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-10 07:49 UTC by Florian Weimer
Modified: 2022-01-23 01:42 UTC (History)
3 users (show)

Fixed In Version: shadow-utils-4.9-9.fc35
Clone Of:
Environment:
Last Closed: 2022-01-23 01:42:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.