Bug 21038

Summary: useradd does not unlock the group file on exit
Product: [Retired] Red Hat Linux Reporter: Jonathan Briggs <jbriggs>
Component: shadow-utilsAssignee: Eido Inoue <havill>
Status: CLOSED DUPLICATE QA Contact: Dale Lovelace <dale>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:47:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Briggs 2000-11-17 21:50:49 UTC
Redhat made a modification to the useradd program that locks the group file
in the open_files function.  However, the close_files function only unlocks
the group file if a change was made.  This leads to a lock file being left
in /etc/group.lock whenever a user is added and a default group specified
with the -g option.

Having this lock file hanging around doesn't seem to cause any problems --
most of the time!  After a reboot or a long uptime, the PID in the lock
file can be reused by another process and when this happens, the useradd
program cannot lock the group file.  If the new process is a daemon, the
useradd program can NEVER lock the group file.

Suggested change: Always unlock the group file on exit.

Comment 1 Martin Kutter 2004-02-24 14:56:17 UTC
On RH9, useradd does not unlock passwd.

Comment 2 Rik van Riel 2004-09-26 20:39:10 UTC
This duplicate order is strange, but the other bug has the fix ;)

*** This bug has been marked as a duplicate of 126709 ***

Comment 3 Red Hat Bugzilla 2006-02-21 18:47:49 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.