Skip to content

Commit

Permalink
base-files: fix merge of passwd/shadow/group lines with trailing colons
Browse files Browse the repository at this point in the history
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: de7ca7d ("base-files: merge /etc/passwd et al at sysupgrade config restore")
Signed-off-by: Matthias Schiffer <[email protected]>
(cherry picked from commit 9bbaa6f)
  • Loading branch information
neocturne committed Aug 29, 2024
1 parent c4c43c6 commit 5773538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package/base-files/files/lib/preinit/80_mount_root
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 5773538

Please sign in to comment.