diff options
author | Arne Schwabe <arne@rfc2549.org> | 2015-06-29 14:46:35 +0200 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2015-06-30 09:15:53 +0200 |
commit | 19475259c92b4747c4c9d3a3d025bdeb170e859c (patch) | |
tree | b5f8e5a7e9e5ca9fefdeb32cf60745e3389f0abb /src/openvpn | |
parent | 40e6c586124e6d7a764b859dad8515998c89c693 (diff) | |
download | openvpn-19475259c92b4747c4c9d3a3d025bdeb170e859c.tar.gz openvpn-19475259c92b4747c4c9d3a3d025bdeb170e859c.tar.xz openvpn-19475259c92b4747c4c9d3a3d025bdeb170e859c.zip |
Report missing endtags of inline files as warnings
(2.3 reports as warning only, 2.4 reports as M_FATAL)
trac #568
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1435581995-11820-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9830
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4)
Diffstat (limited to 'src/openvpn')
-rw-r--r-- | src/openvpn/options.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c index ff4b07b..98ddb69 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3757,10 +3757,15 @@ read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc) char line[OPTION_LINE_SIZE]; struct buffer buf = alloc_buf (8*OPTION_LINE_SIZE); char *ret; + bool endtagfound = false; + while (in_src_get (is, line, sizeof (line))) { if (!strncmp (line, close_tag, strlen (close_tag))) - break; + { + endtagfound = true; + break; + } if (!buf_safe (&buf, strlen(line))) { /* Increase buffer size */ @@ -3772,6 +3777,8 @@ read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc) } buf_printf (&buf, "%s", line); } + if (!endtagfound) + msg (M_WARN, "WARNING: Endtag %s missing", close_tag); ret = string_alloc (BSTR (&buf), gc); buf_clear (&buf); free_buf (&buf); |