Problem with freebsd-update corrupting /etc/passwd

Paul Schmehl pschmehl_lists at tx.rr.com
Fri Aug 21 02:56:49 UTC 2015


--On August 20, 2015 at 8:39:17 PM -0600 Paul Smith 
<paul.j.smith0 at 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 at mail /var/spool/spam]# ls -lsa /etc/passwd
4 -rw-r--r--  1 root  wheel  2615 Aug 21 02:50 /etc/passwd
[root at mail /var/spool/spam]# ls -lsa /etc/master.passwd
4 -rw-------  1 root  wheel  3105 Aug 20 03:33 /etc/master.passwd
[root at 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



More information about the freebsd-questions mailing list