Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2015 21:56:46 -0500
From:      Paul Schmehl <pschmehl_lists@tx.rr.com>
To:        Paul Smith <paul.j.smith0@gmail.com>
Cc:        Mark Felder <feld@freebsd.org>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Problem with freebsd-update corrupting /etc/passwd
Message-ID:  <82DB7ED5BD3DDE54744184E2@Pauls-MacBook-Pro.local>
In-Reply-To: <CACoaAtM2w5DvhDmcrJLjS3icPxD9aghGMRqkV0-B52FwPYFVkA@mail.gmail.com>
References:  <DDFA21B09874CB3B989F4507@Pauls-MacBook-Pro.local> <1440100869.935695.361630681.4EA48DB2@webmail.messagingengine.com> <0904D22E43B1B6A9D578E512@Pauls-MacBook-Pro.local> <CACoaAtM2w5DvhDmcrJLjS3icPxD9aghGMRqkV0-B52FwPYFVkA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--On August 20, 2015 at 8:39:17 PM -0600 Paul Smith 
<paul.j.smith0@gmail.com> wrote:

>>
>> The top three lines of the file (that I renamed .bak because it was
>> corrupted) are:
>>
>> # cat /etc/passwd.bak
>> # $FreeBSD: releng/10.2/etc/master.passwd 256366 2013-10-12 06:08:18Z
>> # rpaulo
>> $
>> #
>> root:*:0:0:Charlie &:/root:/bin/csh
>>
>> # pwd_mkdb -C /etc/passwd.bak
>> pwd_mkdb: corrupted entry
>> pwd_mkdb: at line #3
>> pwd_mkdb: /etc/passwd.bak: Inappropriate file type or format
>>
>
> I thought you ran pwd_mkdb on /etc/master.password and not /etc/password.
>
>> From the man page for pwd_mkdb:
>
> Regenerate the password database after manually editing or replacing
> the password file:
> /usr/sbin/pwd_mkdb -p /etc/master.passwd
>

Doing that corrupts the file in exactly the same way that they were 
corrupted.

# pwd_mkdb -p /etc/master.passwd
[root@mail /var/spool/spam]# ls -lsa /etc/passwd
4 -rw-r--r--  1 root  wheel  2615 Aug 21 02:50 /etc/passwd
[root@mail /var/spool/spam]# ls -lsa /etc/master.passwd
4 -rw-------  1 root  wheel  3105 Aug 20 03:33 /etc/master.passwd
[root@mail /var/spool/spam]# pwd_mkdb -C /etc/passwd
pwd_mkdb: corrupted entry
pwd_mkdb: at line #3
pwd_mkdb: /etc/passwd: Inappropriate file type or format

-p creates the file in Version 7 format, which is incorrect for 
10.2-RELEASE.

Paul Schmehl, Retired
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
"There are some ideas so wrong that only a very
intelligent person could believe in them." George Orwell




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