summaryrefslogtreecommitdiff
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2015-08-10 16:45:51 +0200
committerAlberto Gonzalez Iniesta <agi@inittab.org>2015-08-10 16:45:51 +0200
commitfd15a53c49ca01530665639f3711604c436601ee (patch)
tree452c73475f617631e23f13c4d176336939521ad7 /src/openvpn/options.c
parentd42fbdd9d8dc05868a9ce749fb43a37e6b75b143 (diff)
parent41ffafc126abd9af67061f4931b7614f3cb898b0 (diff)
Merge tag 'upstream/2.3.8'
Upstream version 2.3.8
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index ff4b07b..007bd8c 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2774,8 +2774,8 @@ options_postprocess_filechecks (struct options *options)
/* ** Password files ** */
#ifdef ENABLE_SSL
- errs |= check_file_access (CHKACC_FILE, options->key_pass_file, R_OK,
- "--askpass");
+ errs |= check_file_access (CHKACC_FILE|CHKACC_ACPTSTDIN,
+ options->key_pass_file, R_OK, "--askpass");
#endif /* ENABLE_SSL */
#ifdef ENABLE_MANAGEMENT
errs |= check_file_access (CHKACC_FILE|CHKACC_ACPTSTDIN,
@@ -3757,11 +3757,16 @@ 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;
- if (!buf_safe (&buf, strlen(line)))
+ {
+ endtagfound = true;
+ break;
+ }
+ if (!buf_safe (&buf, strlen(line)+1))
{
/* Increase buffer size */
struct buffer buf2 = alloc_buf (buf.capacity * 2);
@@ -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);