summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer2024-08-29 18:24:02 +0000
committerMatthias Schiffer2024-08-29 19:07:15 +0000
commit9bbaa6f2c0419739fb85d48d0f527cb1622946ee (patch)
treec1e55f5aef4839f80f70602ac9f9ff3104b152e8
parent51f96278ed121546fa5788d717fd8a9635a56158 (diff)
downloadopenwrt-9bbaa6f2c0419739fb85d48d0f527cb1622946ee.tar.gz
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>
-rw-r--r--package/base-files/files/lib/preinit/80_mount_root2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root
index fa6abcde57..940c56c925 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"
}