Opened 4 years ago
Closed 3 years ago
#1325 closed Bug / Defect (fixed)
line counting for config file errors is wrong if inline material is used
Reported by: | Gert Döring | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | release 2.5 |
Component: | Configuration | Version: | OpenVPN git master branch (Community Ed) |
Severity: | Not set (select this one, unless your'e a OpenVPN developer) | Keywords: | line numbers, inline |
Cc: | Antonio Quartulli, plaisthos |
Description
I have a config that happens to have <cert>, <key> etc. *before* the ifconfig stuff (usually it is the other way around), and there was a mistake
OpenVPN logs
Options error: Unrecognized option or missing or extra parameter(s) in standalone-server.ovpn:106: ifconfig-ipv6 (2.5_git)
but the actual line was like "300".
So it seems that inline material is only counted as "one line", and the line numbers are off afterwards.
Since this is confusing to users, it would be good to have fixed for 2.5.0
Change History (4)
comment:1 Changed 4 years ago by
Version: | easyrsa master branch → OpenVPN git master branch (Community Ed) |
---|
comment:2 Changed 4 years ago by
Cc: | Antonio Quartulli plaisthos added |
---|
comment:4 Changed 3 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
commit a686f7e29af012783371f401f394ac1e62e5b75f (master)
commit 97af8b3101af6a1f8fef778d2c9e0e5f13d2d440 (release/2.5)
commit 8ce5a319fd7a9b13ed6fee92fbda567c24f832c5 (release/2.4)
Author: Gert Doering
Date: Sun Dec 6 13:57:11 2020 +0100
Fix line number reporting on config file errors after <inline> segments
Acked-by: Antonio Quartulli <antonio@…>
Message-Id: <20201206125711.12071-1-gert@…>
Looked through options.c a bit.
The call chain is (here)
the whole "check_inline*" call chain does not increment
line_num
or signal back the number of lines it has consumed.I see two ways to approach this