The init sequence was changed to daemonize before the crypto init to fix
issues on FreeBSD some commits ago. This introduced a regression where
we would no longer query for passwords before daemonizing, as described
in trac #574 and #576.
This commit restores the correct order, and adds a bit of const
correctness since we're touching this now code anyway.
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
1436477759-5884-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9901
Signed-off-by: Gert Doering <gert@greenie.muc.de>
/*
* Query for private key and auth-user-pass username/passwords
*/
-static void
-init_query_passwords (struct context *c)
+void
+init_query_passwords (const struct context *c)
{
#ifdef ENABLE_CRYPTO
/* Certificate password input */
init_connection_list (c);
- init_query_passwords (c);
-
#if defined(ENABLE_PKCS11)
if (c->first_time) {
int i;
void init_instance (struct context *c, const struct env_set *env, const unsigned int flags);
+/**
+ * Query for private key and auth-user-pass username/passwords.
+ */
+void init_query_passwords (const struct context *c);
+
void do_route (const struct options *options,
struct route_list *route_list,
struct route_ipv6_list *route_ipv6_list,
/* test crypto? */
if (do_test_crypto (&c.options))
break;
-
+
+ /* Query passwords before becoming a daemon */
+ init_query_passwords (&c);
+
/* become a daemon if --daemon */
if (c.first_time)
{