Bug 229487 - Password database out of sync after binary update from 10.3
Summary: Password database out of sync after binary update from 10.3
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-07-03 10:18 UTC by Michael Gmelin
Modified: 2019-03-05 18:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gmelin freebsd_committer freebsd_triage 2018-07-03 10:18:16 UTC
After updating multiple machines from 10.3 to 11.2 using freebsd-update(8), they all suffer from the same problem:

# pw useradd -n removemenow -u 3333 -g nobody -s /bin/false -h -
pw: user 'removemenow' disappeared during update

At this point removemenow is in /etc/master.passwd and I can also find traces of it in pwd.db, yet:

# id removemenow
id: removemenow: no such user

Running

# pwd_mkdb -p /etc/master.passwd

fixes the issue, but this is quite irritating.

Also note that pwd.db has the time timestamp as master.passwd after the update (so something got rewritten there) and it also changes after running "pw".

This is most likely a duplicate of #165954, still opening it, as it affects 11.2-RELEASE (and therefore should probably be mentioned in RELEASE ERRATA).
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-01-21 19:05:07 UTC
A commit references this bug:

Author: emaste
Date: Mon Jan 21 19:04:38 UTC 2019
New revision: 343270
URL: https://svnweb.freebsd.org/changeset/base/343270

Log:
  freebsd-update: Update /etc/passwd after password db changes

  Add -p to pwd_mkdb in order to ensure password db changes are also
  included in /etc/passwd.

  PR:		165954, 232921, 229487
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reviewed by:	jilles
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D18827

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2019-01-26 17:11:21 UTC
Who would've thought. Closing the ticket, as this sounds like the proper fix.
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-03-05 18:29:43 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 18:29:26 UTC 2019
New revision: 344809
URL: https://svnweb.freebsd.org/changeset/base/344809

Log:
  MFC r343270: freebsd-update: Update /etc/passwd after password db changes

  Add -p to pwd_mkdb in order to ensure password db changes are also
  included in /etc/passwd.

  PR:		165954, 232921, 229487
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reviewed by:	jilles
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/12/
  stable/12/usr.sbin/freebsd-update/freebsd-update.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-03-05 18:31:00 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 18:30:44 UTC 2019
New revision: 344810
URL: https://svnweb.freebsd.org/changeset/base/344810

Log:
  MFC r343270: freebsd-update: Update /etc/passwd after password db changes

  Add -p to pwd_mkdb in order to ensure password db changes are also
  included in /etc/passwd.

  PR:		165954, 232921, 229487
  Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
  Reviewed by:	jilles
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/usr.sbin/freebsd-update/freebsd-update.sh