1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-11-08 07:49:21 +01:00

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>
This commit is contained in:
Matthias Schiffer 2024-08-29 20:24:02 +02:00
parent 51f96278ed
commit 9bbaa6f2c0
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

@ -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"
}