firstboot: handle missing root password entries
authorDan Nicholson <dbn@endlessos.org>
Tue, 30 Jul 2024 19:42:26 +0000 (13:42 -0600)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 13:04:41 +0000 (14:04 +0100)
commit847dd914d0ee0e6f3ca576891b82896ee3e68d99
tree2bec498675d1ffb4a90c0951ea46a71bd538b766
parentcab78ad49f42e33057ce8fea7f290069197c4bf2
firstboot: handle missing root password entries

If /etc/passwd and/or /etc/shadow exist but don't have an existing root entry,
one needs to be added. Previously this only worked if the files didn't exist.

(cherry picked from commit 2319154a6bec7b8c42e901dfacaefe95bf4e3750)
src/firstboot/firstboot.c
test/units/TEST-74-AUX-UTILS.firstboot.sh