Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#569 closed Bug / Defect (fixed)

White space before end tags can break the config parser

Reported by: Samuli Seppänen Owned by:
Priority: major Milestone: release 2.3.9
Component: Generic / unclassified Version: OpenVPN git master branch (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: parser
Cc: plaisthos

Description

This one works:

### connection #1
   <connection>
    remote server.ip.add port
</connection>

This one does not:

### connection #2
   <connection>
   remote server.ip.add port
   </connection>

Instead it throws an error. On 2.3_git [20150526_1222]:

Options error: Unrecognized option or missing parameter(s) in [CONNECTION-OPTIONS]:2: /connection (2.3_git)
Use --help for more information.

On Windows + OpenVPN 2.3.6:

Options error: Unrecognized option or missing parameter(s) in [CONNECTION-OPTIONS]:2: /connection (2.3.6)
Use --help for more information.
Press any key to continue...

It looks like the config parser sees the linefeed, thinks there's another directive coming up and barfs when the next line (directive) has no content except spaces. I think we should fix it in the code if possible.

This was originally reported by debbie10t as a part of ticket #395

Change History (6)

comment:1 Changed 5 years ago by Gert Döring

Cc: Steffan Karger added

cc: to our config wonder man

comment:2 Changed 5 years ago by Gert Döring

Cc: plaisthos added; Steffan Karger removed

wrong vict... uh... volunteer

Last edited 5 years ago by Gert Döring (previous) (diff)

comment:3 Changed 5 years ago by Gert Döring

Milestone: release 2.3.8release 2.3.9

comment:4 Changed 5 years ago by debbie10t

I noticed this ([PATCH] Fix trac ticket #569):
http://sourceforge.net/p/openvpn/mailman/openvpn-devel/thread/1444493569-24026-1-git-send-email-janjust%40nikhef.nl/#msg34530633

So I did some quick tests and they all passed correctly.

comment:5 Changed 5 years ago by Gert Döring

Resolution: fixed
Status: newclosed

That patch actually does *not* work for all cases, but plaisthos put in a fixed patch - so in git we now have

commit c67acea173dc9ee37220f5b9ff14ede081181992
Author: janjust <janjust@…>
Date: Sat Oct 10 18:12:49 2015 +0200

Fix "White space before end tags can break the config parser"

commit cba33989101175ac07434b9c5cceba116bf38127
Author: Arne Schwabe <arne@…>
Date: Wed Oct 14 15:05:56 2015 +0200

Fix commit c67acea173dc9ee37220f5b9ff14ede081181992

... and with that, it really should work now. Both patches are in the release/2.3 branch as well, to be relased as part of 2.3.9.

Closing this ticket for now.

comment:6 Changed 5 years ago by debbie10t

Sorry .. I did not make myself clear: I tested git/master cloned 20151016 (today)

Last edited 5 years ago by debbie10t (previous) (diff)
Note: See TracTickets for help on using tickets.