From nobody  Sat May  3 05:20:26 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id FAA26719;
          Sat, 3 May 1997 05:20:26 -0700 (PDT)
Message-Id: <199705031220.FAA26719@hub.freebsd.org>
Date: Sat, 3 May 1997 05:20:26 -0700 (PDT)
From: poon@samart.co.th
To: freebsd-gnats-submit@freebsd.org
Subject: pwd_mkdb and passwd
X-Send-Pr-Version: www-1.0

>Number:         3478
>Category:       bin
>Synopsis:       pwd_mkdb and passwd
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May  3 05:30:01 PDT 1997
>Closed-Date:    Sat Dec 12 18:08:10 PST 1998
>Last-Modified:  Sat Dec 12 18:11:17 PST 1998
>Originator:     Poon Rojanasoonthon
>Release:        FreeBSD 2.1.5-RELEASE
>Organization:
Samart Infonet
>Environment:
FreeBSD radius-server 2.1.5-RELEASE FreeBSD 2.1.5-RELEASE #1: Wed Apr  2 20:35:08  1997     root@myname.my.domain:/usr/src/sys/compile/DLINK  i386 
>Description:
pwd_mkdb will not update the database
if a user changed their password while pwd_mkdb was running.
>How-To-Repeat:
Run pwd_mkdb on a large master.passwd (so changing password will 
occur during the pwd_mkdb is running) and change a password.
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Sat Dec 12 18:08:10 PST 1998 
State-Changed-Why:  
I've committed changes to freebsd-current to have pwd_mkdb lock 
the specified source file while rebuilding the database.  I have 
also fixed a small race condition in vipw/pwd_mkdb/chpass/passwd. 
Note, however, that no changes have been commited to the old  
2.x.x-stable release as the final release (2.2.8) has been made 
in that branch. 

You can work around the problem for your particular application by 
writing a simple wrapper to hold a lock on master.passwd whlie you 
are rebuilding the db's, but if you do do that remember that if/when 
you ever upgrade to 3.x.x, the locking will become inherent to pwd_mkdb. 

-Matt 
>Unformatted:
