summaryrefslogtreecommitdiff
path: root/src/openvpn/openvpn.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/openvpn.c
parentd42fbdd9d8dc05868a9ce749fb43a37e6b75b143 (diff)
parent41ffafc126abd9af67061f4931b7614f3cb898b0 (diff)
Merge tag 'upstream/2.3.8'
Upstream version 2.3.8
Diffstat (limited to 'src/openvpn/openvpn.c')
-rw-r--r--src/openvpn/openvpn.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 2f327f3..32e326e 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -228,15 +228,28 @@ openvpn_main (int argc, char *argv[])
/* test crypto? */
if (do_test_crypto (&c.options))
break;
-
+
+ /* Query passwords before becoming a daemon if we don't use the
+ * management interface to get them. */
+#ifdef ENABLE_MANAGEMENT
+ if (!(c.options.management_flags & MF_QUERY_PASSWORDS))
+#endif
+ init_query_passwords (&c);
+
/* become a daemon if --daemon */
if (c.first_time)
- c.did_we_daemonize = possibly_become_daemon (&c.options);
+ {
+ c.did_we_daemonize = possibly_become_daemon (&c.options);
+ write_pid (c.options.writepid);
+ }
#ifdef ENABLE_MANAGEMENT
/* open management subsystem */
if (!open_management (&c))
break;
+ /* query for passwords through management interface, if needed */
+ if (c.options.management_flags & MF_QUERY_PASSWORDS)
+ init_query_passwords (&c);
#endif
/* set certain options as environmental variables */