Bug 2157669

Summary: Failure during useradd or groupadd does not print enough details
Product: [Fedora] Fedora Reporter: Petr Menšík <pemensik>
Component: shadow-utilsAssignee: Iker Pedrosa <ipedrosa>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: rawhideCC: ipedrosa, pvrabec, tm
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 2149036    

Description Petr Menšík 2023-01-02 14:59:35 UTC
Description of problem:
In bug #2149036 anaconda team reported failure during install. It fails to add group from %pre script. Because I am not able to step it interactively, I am just guessing what might be the cause of it. I think if file open fails, it should print also reason given by errno.

Version-Release number of selected component (if applicable):
shadow-utils-4.13-3.fc38.x86_64

How reproducible:
not straightforward, but reliable

Steps to Reproduce:
1. make groupadd fail
2. printed error message should make it clear what is the cause.
3.

Actual results:
groupadd: cannot open /etc/group
useradd: group 'unbound' does not exist

Expected results:
Also a reason should be printed. I expect it to be EPERM or ENOENT, but I should not need to guess.

Additional info:
Details in bug #2149036 comment #9.