base-files: fix merge of passwd/shadow/group lines with trailing colons librecmc-v6.0
authorMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 29 Aug 2024 18:24:02 +0000 (20:24 +0200)
committerRISCi_ATOM <bob@bobcall.me>
Tue, 3 Sep 2024 15:49:22 +0000 (11:49 -0400)
commitf7da318eeb6db093da7b8d07f2d0e66d3f597ca0
tree64b3a4fda6069c9c7f4eab31e9e748a8df04d67e
parente0154c1fdd98d19fe0d8be78b35ebc41d28d7d06
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