Bug 165954 - freebsd-update(8) doesn't run pwd_mkdb after adding user
Summary: freebsd-update(8) doesn't run pwd_mkdb after adding user
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
: 213374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-12 00:40 UTC by kevin
Modified: 2019-03-05 18:38 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kevin 2012-03-12 00:40:05 UTC
When using freebsd-update to go from 8.x to 9.0-RELEASE, it adds the "hast" user/group to /etc/passwd /etc/master.passwd /etc/group

However, it doesn't run pwd_mkdb afterwards so /etc/pwd.db and /etc/spwd.db don't get updated to contain the new user. hastd won't start (because it can't find its user) until you manually run pwd_mkdb after upgrading.

Fix: 

freebsd-update probably should run pwd_mkdb after an update if it altered the password file.

It also might want to run some of the other things that mergemaster does, like cap_mkdb on login.conf and services_mkdb if it's not directly replacing those .db files.
How-To-Repeat: 
Use freebsd-update to upgrade from 8.x to 9.0, then try starting hastd.
Comment 1 patrick 2014-02-24 19:42:38 UTC
I've notice the same thing happen on a number of upgrades using =
freebsd-update, and each time the fix has been to manually run pwd_mkdb.=
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-04-14 00:24:27 UTC
Responsible Changed
From-To: freebsd-bugs->cperciva

Over to maintainer.
Comment 3 VK 2016-12-19 23:55:32 UTC
*** Bug 213374 has been marked as a duplicate of this bug. ***
Comment 4 Ed Maste freebsd_committer freebsd_triage 2016-12-28 05:12:25 UTC
freebsd-update is supposed to run pwd_mkdb if necessary - see https://svnweb.freebsd.org/changeset/base/173564

I have a first-hand report of this happening recently on an update to 11.x but have not yet reproduced it myself. I'm sure I'll provoke it eventually but if someone can provide exact reproduction steps starting with a FreeBSD VM image I'd appreciate it.
Comment 5 VK 2017-01-02 22:02:35 UTC
(In reply to Ed Maste from comment #4)

In my case it was adding a user immediately after upgrading from 10.3 to 11. I could replicate that on two independent systems I upgraded.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:44:24 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-01-21 19:05:00 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 8 commit-hook freebsd_committer freebsd_triage 2019-03-05 18:29:50 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 9 commit-hook freebsd_committer freebsd_triage 2019-03-05 18:30:54 UTC
A commit references this bug:

Author: emaste
Date: Tue Mar  5 18:30:43 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