Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Nov 1997 00:38:35 -0800 (PST)
From:      Tom <tom@sdf.com>
To:        hackers@freebsd.org
Subject:   Re: Password file builds
Message-ID:  <Pine.BSF.3.95q.971101003810.11908C-100000@misery.sdf.com>

next in thread | raw e-mail | index | archive | help

On Fri, 31 Oct 1997, Dave Chapeskie wrote:

> On Fri, Oct 31, 1997 at 09:22:31AM -0800, Tom wrote:
> >   The biggest problem with this is, that there are no tools to fix or
> > verify db files.  If the /etc/pwd.db or /etc/spwd.db becomes damaged,
> > you're screwed.
> 
> So you regenerate the text version periodicly (if required) from cron
> and you keep backups of the database and text versions.  You do keep
> backups don't you?

  How would the text version be regenerated?  In the scheme you described
there would be no test version.

> >   Also, there are locking issue with in place updates of db files.
> > Do the pw routines in libc even do locking?  I don't think so.  What
> > happens if someone calls getpwnam() at the while someone else is
> > writing a new entry into the database?
> 
> The man page for pwd_mkdb clearly states that it leaves locking up to
> the front-ends (chpass, passwd, vipw).  That locking would still be
> maintained, just the text file wouldn't be updated.

  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.

> -- 
> Dave Chapeskie, DDM Consulting
> E-Mail: dchapes@ddm.on.ca

Tom





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.971101003810.11908C-100000>