Subject: Re: Verify pwd.db file?
To: Andy Ruhl <acruhl@gmail.com>
From: matthew sporleder <msporleder@gmail.com>
List: netbsd-users
Date: 06/15/2007 11:20:07
On 6/15/07, Andy Ruhl <acruhl@gmail.com> wrote:
> Is there a way to verify that the pwd.db file matches what's in
> /etc/master.passwd?
>
> I suppose I could use pwd_mkdb to make a new pwd.db, then diff the
> two, but it seems like there should be a simple way to verify without
> needing to do that.
>
> Is there?


It doesn't look like pws_mkdb diffs the files at all, it simply
overwrites the old one:
BUGS
     Because of the necessity for atomic update of the password files,
     pwd_mkdb uses rename(2) to install them.  This, however, requires that
     the file specified on the command line live on the same file system as
     the ``/etc'' directory.


So an option like "Show what would be done, but don't actually do it"
would require more serious changes.  (writing out to a different
pwd.db and comparing seems to be the way to go)