Null entries in passwd

Kenneth A. Reek kar at ritcv.UUCP
Sun Jun 3 23:28:50 AEST 1984


The "passwd" and "chfn" programs we got with our 4.1 distribution a long time
ago used a very naive locking protocol that failed due to a race condition.
This sometimes resulted in one user's passwd process reading the file at the
same time another user's process was writing it, resulting in missing fields,
truncating the passwd file, and so forth.  We changed the passwd program to
use the "link" protocol for file locking and have not had any problems since.

I just took a quick look at the 4.2 passwd code, and the problem appears to be
solved by the use of the exclusive option when opening the lock file.

	Ken Reek, Rochester Institute of Technology
	{allegra,seismo}!rochester!ritcv!kar



More information about the Comp.bugs.4bsd.ucb-fixes mailing list