]> git.ipfire.org Git - ipfire-2.x.git/commit
initscripts: readhash: Fix handling = signs
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Dec 2024 16:42:17 +0000 (16:42 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 18 Dec 2024 07:14:06 +0000 (08:14 +0100)
commitff4ff2cfe0c8565a431bf499708dcb6e5c2fb3dc
treea76fab0ee61a6ed0262fc230e04053d0e8a00193
parent73661e5ee1acc30e40e41493c8dfca10aa1097d0
initscripts: readhash: Fix handling = signs

The function expected that a line only contains exactly one equals sign
(=) which is not fit for purpose. In the WireGuard code we hold key
material that is encoded in base64 and therefore contains padding that
uses =.

This patch fixes that we expect exactly one equals sign immediately
after the key and we will then accept more = in the value - which was
already permitted.

Furthermore, this patch fixes the splitting if the key and value at the
first =.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/functions
tests/src/initscripts/system/functions/data/2_output_stderr