]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix sequence of events for async plugin v1 handler.
authorGert Doering <gert@greenie.muc.de>
Mon, 27 Jul 2020 18:34:35 +0000 (20:34 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 28 Jul 2020 07:45:10 +0000 (09:45 +0200)
If multi_client_connect_call_plugin_v1() goes to "deferred mode",
*and* there is no OPENVPN_CLIENT_CONNECT_DEFER handler, we
would read the "client specific options" file after every
(succeeded-because-not-present) call to plugin_call().

Move this to "after we have checked the deferred-cc file, and we
know for sure that we have CC_RET_SUCCEEDED".

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20200727183436.6625-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20613.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/multi.c

index 9bda38b09129044a5e2e1689918698450015736b..cfb34720d3928b05ac3387922d3bd16bab01d33f 100644 (file)
@@ -2065,8 +2065,6 @@ multi_client_connect_call_plugin_v1(struct multi_context *m,
                                    &argv, NULL, mi->context.c2.es);
         if (plug_ret == OPENVPN_PLUGIN_FUNC_SUCCESS)
         {
-            multi_client_connect_post(m, mi, ccs->config_file,
-                                      option_types_found);
             ret = CC_RET_SUCCEEDED;
         }
         else if (plug_ret == OPENVPN_PLUGIN_FUNC_DEFERRED)
@@ -2100,6 +2098,13 @@ multi_client_connect_call_plugin_v1(struct multi_context *m,
         {
             ret = CC_RET_DEFERRED;
         }
+
+        /* if we still think we have succeeded, do postprocessing */
+        if (ret == CC_RET_SUCCEEDED)
+        {
+            multi_client_connect_post(m, mi, ccs->config_file,
+                                      option_types_found);
+        }
 cleanup:
         argv_free(&argv);