mirror of
https://github.com/openwrt/openwrt.git
synced 2025-03-22 03:55:22 +00: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> (cherry picked from commit 9bbaa6f2c0419739fb85d48d0f527cb1622946ee)
This commit is contained in:
parent
c4c43c64aa
commit
5773538c90
@ -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"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user