From owner-freebsd-hackers Sat Nov 1 02:03:53 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA11382 for hackers-outgoing; Sat, 1 Nov 1997 02:03:53 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from ymris.ddm.on.ca (cisco1-45.cas.golden.net [207.6.168.45]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA11373 for ; Sat, 1 Nov 1997 02:03:44 -0800 (PST) (envelope-from dchapes@golden.net) Received: from squigy.ddm.on.ca (squigy.ddm.on.ca [209.47.139.138]) by ymris.ddm.on.ca (8.8.7/8.8.7) with ESMTP id FAA24612 for ; Sat, 1 Nov 1997 05:03:10 -0500 (EST) Received: (from dchapes@localhost) by squigy.ddm.on.ca (8.8.7/8.8.7) id FAA01245; Sat, 1 Nov 1997 05:03:08 -0500 (EST) Message-ID: <19971101050308.10677@golden.net> Date: Sat, 1 Nov 1997 05:03:08 -0500 From: Dave Chapeskie To: hackers@FreeBSD.ORG Subject: Re: Password file builds References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81 In-Reply-To: ; from Tom on Sat, Nov 01, 1997 at 12:38:35AM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sat, Nov 01, 1997 at 12:38:35AM -0800, Tom wrote: > How would the text version be regenerated? In the scheme you described > there would be no test version. It would be regenerated from the database, it turns out that currently one of the indexes on the database is the line number from the text file. Re-read my original message, there I sugest running such a program from crontab to keep a complete or partial text version. Vipw would need to be modified to update the text version before editing. > Nope, you missed the point. The getpw* routines in libc do not do > locking, because they don't need to. But if you do inplace updates, they > do. rename() is atomic, but db put() is not. Ah, I see your point. You're right I missed this. It's something to pay attention to but it's not a major problem IMHO. Either do things the way "pwd_mkdb -u" currently does or use flock(2) on the database's file descriptor in the password routines in libc. -- Dave Chapeskie, DDM Consulting E-Mail: dchapes@golden.net