Date: Thu, 22 Aug 2019 12:43:19 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> To: Alan Somers <asomers@freebsd.org>, Tom Samplonius <tom@samplonius.org> Cc: FreeBSD <freebsd-stable@freebsd.org> Subject: Re: chsh corrupts /etc/pwd.db Message-ID: <c749c935-a3a6-e383-1994-2d79e7517be6@quip.cz> In-Reply-To: <7f7ff711-342e-fc8a-d2c9-50dd1a90acd8@quip.cz> References: <CAOtMX2gTTerT5q3Ooku%2BwMOg_tZysFCBeHeBPkH_49aJFBu47A@mail.gmail.com> <208B5647-9D41-4F0E-9111-32CBFF8491D1@samplonius.org> <CAOtMX2ibvCW1_7UQ7_Udb1tqR2BfGVzPfqhhaH0sRxeZZfXJBw@mail.gmail.com> <7f7ff711-342e-fc8a-d2c9-50dd1a90acd8@quip.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
Miroslav Lachman wrote on 2019/08/22 11:21: > Alan Somers wrote on 2019/08/22 04:07: >>> Unless, of course your master.passwd file was damaged. But the *.db >>> files are really just caches for faster access to user data. The >>> real master file is master.passwd. >>> >>> >>> The ch* tools typically just change master.passwd, and then call >>> pwd_mkdb to rebuild the *.db files. >> >> The pwd.db file from before the snapshot only has three entries. From >> after, it has four, and one of them has the wrong shell. So it does >> seem that chsh is corrupting the file. And fortunately the problem is >> repeatable. Any ideas about how to debug it? >> >> -Alan >> >> P.S. I failed to mention earlier that this is happening on >> 12.0-RELEASE-p10 > > I run in to something similar from time to time from about 10.x or 8.x > (i skipped 9.x) > I do not remember exactly what command did the corruption, if it was > vipw or chsh or something else to manipulate user database. The fix was > easy - run it again or use pwd_mkdb I searched our archive of issues and found it. It was error with "pw" command which sometimes failed in very weird way: # pw useradd -n user1 -u 1003 -G wheel -s /bin/tcsh -m -M 0700 -c "User One" pw: user 'user1' disappeared during update It was on FreeBSD 8.x. So it is different error than yours. Miroslav Lachman
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c749c935-a3a6-e383-1994-2d79e7517be6>