base-files: fix merge of passwd/shadow/group lines with trailing colons
authorMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 29 Aug 2024 18:24:02 +0000 (20:24 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 29 Aug 2024 19:07:48 +0000 (21:07 +0200)
commit5773538c907610ebfd1ea13701383e511b7fd00b
tree1f9fa82cd2ca339c5b8486c55218fa1a78c3c48e
parentc4c43c64aa6c5ba44322ddefa106b9e707b64781
base-files: fix merge of passwd/shadow/group lines with trailing colons

Empty trailing fields get lost when the lines are split and merged again
at colons, resulting in unparsable entries. Only use the split fields for
matching against the other file, but emit the original line unchanged
to fix the issue.

Fixes: de7ca7dafadf ("base-files: merge /etc/passwd et al at sysupgrade config restore")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 9bbaa6f2c0419739fb85d48d0f527cb1622946ee)
package/base-files/files/lib/preinit/80_mount_root