libreswan/libreswan — pull request #20 by lkundrak (2014-11-24 17:06:34+00:00)
Title: libipsecconf: Avoid bad seek

fseek(-1L, SEEK_END) causes lseek(0, SEEK_CUR) on ordinary files, causing a
seek to the beginning and duplicate file parse. On pipes, it does not work
at all, causing the EOL to be inserted even when it was there:

can not load config '-': -:21: syntax error, unexpected EOL, expecting $end []

Too bad NetworkManager feeds the connection configuration into a pipe.

Let's just add the trailing line break unconditionally and allow the trailing
blank lines in grammar.