]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix line number reporting on config file errors after <inline> segments
authorGert Doering <gert@greenie.muc.de>
Sun, 6 Dec 2020 12:57:11 +0000 (13:57 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 6 Dec 2020 18:27:24 +0000 (19:27 +0100)
commit97af8b3101af6a1f8fef778d2c9e0e5f13d2d440
treeb1a899fa0b2d62735a514438b41a5bd4293aa6d4
parentc27f97dc0ac99344659cca57bd048543a9899266
Fix line number reporting on config file errors after <inline> segments

<inline> segments neglected to increment the "current line number
in config file" variable (line_num), so after the first <inline>,
errors reported have the wrong line number.

Fix by introducing an extra argument to read_inline_file() function:
"so many lines in the inline block", and changing the return values of
the "check_inline*()" functions to "int", changing this from "false/true"
to "0 = no inline, 1...N = inline with <N> lines".

On calling add_options() this is implicitly converted back to bool.

v2: use int return value, not extra call-by-reference parameter

Trac: #1325
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20201206125711.12071-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21334.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit a686f7e29af012783371f401f394ac1e62e5b75f)
src/openvpn/options.c