]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Move the initialization of the environment to the top so c2.es is initialized
authorArne Schwabe <arne@rfc2549.org>
Fri, 21 Mar 2014 13:18:35 +0000 (14:18 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 21 Mar 2014 18:38:11 +0000 (19:38 +0100)
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-3-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8372

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c

index 3b72b964480b6b007c76008e9df3574ea4f13c4e..c50b5c2609fd6de47ae8df4153c123f0d3737e91 100644 (file)
@@ -3339,6 +3339,10 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
   /* init garbage collection level */
   gc_init (&c->c2.gc);
 
+  /* inherit environmental variables */
+  if (env)
+     do_inherit_env (c, env);
+
   /* signals caught here will abort */
   c->sig->signal_received = 0;
   c->sig->signal_text = NULL;
@@ -3390,10 +3394,6 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
   if (c->mode == CM_P2P || c->mode == CM_TOP)
     do_option_warnings (c);
 
-  /* inherit environmental variables */
-  if (env)
-    do_inherit_env (c, env);
-
 #ifdef ENABLE_PLUGIN
   /* initialize plugins */
   if (c->mode == CM_P2P || c->mode == CM_TOP)