Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Nov 1997 05:03:08 -0500
From:      Dave Chapeskie <dchapes@golden.net>
To:        hackers@FreeBSD.ORG
Subject:   Re: Password file builds
Message-ID:  <19971101050308.10677@golden.net>
In-Reply-To: <Pine.BSF.3.95q.971101003810.11908C-100000@misery.sdf.com>; from Tom on Sat, Nov 01, 1997 at 12:38:35AM -0800
References:  <Pine.BSF.3.95q.971101003810.11908C-100000@misery.sdf.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971101050308.10677>