From: Matthias Schiffer Date: Thu, 29 Aug 2024 18:24:02 +0000 (+0200) Subject: base-files: fix merge of passwd/shadow/group lines with trailing colons X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f7da318eeb6db093da7b8d07f2d0e66d3f597ca0;p=librecmc%2Flibrecmc.git 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 (cherry picked from commit 9bbaa6f2c0419739fb85d48d0f527cb1622946ee) --- diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root index c3816c2cbf..ccfc481285 100644 --- a/package/base-files/files/lib/preinit/80_mount_root +++ b/package/base-files/files/lib/preinit/80_mount_root @@ -9,7 +9,7 @@ missing_lines() { IFS=":" while read line; do set -- $line - grep -q "^$1:" "$file2" || echo "$*" + grep -q "^$1:" "$file2" || echo "$line" done < "$file1" IFS="$oIFS" }