mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
initscripts fkt: readhash should only parse lines with a =
A line without a = is clearly invalid. Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
9f72b7bc5f
commit
f1d94e7457
@@ -910,6 +910,12 @@ readhash() {
|
||||
continue
|
||||
fi
|
||||
|
||||
# Skip lines without a =
|
||||
if ! [[ ${line} =~ [^=]*=[^=]*$ ]]; then
|
||||
echo "Invalid line '${line}'" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
local key="${line%=*}"
|
||||
local val="${line#*=}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user