Bug 234014 - chown: ntpd: illegal user name -- after freebsd-update to 12.0
Summary: chown: ntpd: illegal user name -- after freebsd-update to 12.0
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: i386 Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-14 15:59 UTC by Eric van Gyzen
Modified: 2018-12-23 20:05 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 Eric van Gyzen freebsd_committer 2018-12-14 15:59:38 UTC
I just updated an i386 machine (not amd64) from 11.2-RELEASE to 12.0-RELEASE using freebsd-update.  On boot, the console says:

chown: ntpd: illegal user name

Sure enough, the ntpd user was in /etc/*passwd but _not_ in /etc/*pwd.db.

# getent passwd ntpd
# grep ntp master.passwd 
ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin
# strings spwd.db  | grep ntp
# strings pwd.db | grep ntp

Also, ntpd is running as root.

The pwd db files were newer than the plain text files, so pwd_mkdb did run during the upgrade:

# stat -x master.passwd passwd spwd.db pwd.db 
  File: "master.passwd"
  Size: 3019         FileType: Regular File
  Mode: (0600/-rw-------)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 0,70   Inode: 1036545    Links: 1
Access: Fri Dec 14 09:30:48 2018
Modify: Fri Dec 14 09:30:48 2018
Change: Fri Dec 14 09:32:39 2018
  File: "passwd"
  Size: 2509         FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 0,70   Inode: 1036629    Links: 1
Access: Fri Dec 14 09:30:48 2018
Modify: Fri Dec 14 09:30:48 2018
Change: Fri Dec 14 09:32:39 2018
  File: "spwd.db"
  Size: 40960        FileType: Regular File
  Mode: (0600/-rw-------)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 0,70   Inode: 1036680    Links: 1
Access: Fri Dec 14 09:48:57 2018
Modify: Fri Dec 14 09:30:50 2018
Change: Fri Dec 14 09:32:40 2018
  File: "pwd.db"
  Size: 40960        FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 0,70   Inode: 1036668    Links: 1
Access: Fri Dec 14 09:48:38 2018
Modify: Fri Dec 14 09:30:49 2018
Change: Fri Dec 14 09:32:40 2018

I wonder if pwd_mkdb ran against the wrong/old master.passwd file?

Simply running pwd_mkdb worked around the problem.
Comment 1 Eric van Gyzen freebsd_committer 2018-12-14 16:05:07 UTC
I didn't have this problem on systems that I upgraded with installworld, so I imagine it's a problem in freebsd-update.
Comment 2 Michael Laß 2018-12-15 11:45:38 UTC
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232921