]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC freebsd-update: unconditionally regenerate passwd/login.conf files
authorKyle Evans <kevans@FreeBSD.org>
Thu, 17 Dec 2020 03:42:54 +0000 (03:42 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sun, 27 Dec 2020 20:50:53 +0000 (14:50 -0600)
commit5cf1ba21eebaf89cf4d8639a18345dc49116d1d5
tree51efc4e9d122c5ea8b920e57a97771fe78bf185e
parent0104423d2844502d904294da65c434d68a9504d1
MFC freebsd-update: unconditionally regenerate passwd/login.conf files

The existing logic is nice in theory, but in practice freebsd-update will
not preserve the timestamps on these files. When doing a major upgrade, e.g.
from 12.1-RELEASE -> 12.2-RELEASE, pwd.mkdb et al. appear in the INDEX and
we clobber the timestamp several times in the process of packaging up the
existing system into /var/db/freebsd-update/files and extracting for
comparisons. This leads to these files not getting regenerated when they're
most likely to be needed.

Measures could be taken to preserve timestamps, but it's unclear whether
the complexity and overhead of doing so is really outweighed by the marginal
benefit.

I observed this issue when pkg subsequently failed to install a package that
wanted to add a user, claiming that the user was removed in the process.
bapt@ pointed to this pre-existing bug with freebsd-update as the cause.

PR: 234014, 232921

(cherry picked from commit ebebc41e4cfe44b8e8fd881badf2fa2c4be65aa4)
usr.sbin/freebsd-update/freebsd-update.sh