Bug 662

Summary: passwd will run while vipw is running
Product: [Retired] Red Hat Linux Reporter: fairlite
Component: passwdAssignee: Cristian Gafton <gafton>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 5.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-04-01 06:07:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description fairlite 1998-12-31 21:55:37 UTC
On RedHat 5.1, if you run vipw, and someone concurrently
runs passwd, passwd will run and modify /etc/passwd even
though /etc/ptmp exists.

This condition would result in a loss of the password
change (or multiple changes) that occurred while vipw was
in operation.

I spoke with "oot" on LinuxNET and he verified the bug,
which apparently also exists in 5.2.  He asked me to report
this bug here.

Comment 1 Preston Brown 1999-03-22 19:00:59 UTC

Do you think we should add a quick check to passwd to look for the
lockfile, and exit if it exists?

Comment 2 Michael K. Johnson 1999-03-23 01:06:59 UTC
glibc vs. vipw locking difference passed on to Cristian to resolve

Comment 3 Cristian Gafton 1999-04-01 06:07:59 UTC
vipw can not lock the passwd file for an extended period of time. The
locking mechanism has an algorithm that will make it avoid deadlocks
from runaway processes (basically wait at most 10 sec before ignoring
the lock and acquiring it for yourself)

vipw will lock the database when it is updating it, checking that the
timestamp was not modified in the meantime.