Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/2219?usp=email )
Change subject: options: let the interactive service add routes again ...................................................................... options: let the interactive service add routes again Since c139e82d the service puts --msg-channel in front of the user options, a --route-method from the config overrides the service route method implicitly set by --msg-channel, and adding routes in turn fails without admin rights. Force the service route method in postprocessing when --msg-channel is used, independent of the option order. Github: OpenVPN/openvpn#1151 Change-Id: I4571033af79092d85657b176044497245faf5e39 Signed-off-by: Heiko Hund <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2219 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg41648.html Signed-off-by: Gert Doering <[email protected]> --- M doc/man-sections/windows-options.rst M src/openvpn/options.c 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/doc/man-sections/windows-options.rst b/doc/man-sections/windows-options.rst index 8d7dcbb..87c7008 100644 --- a/doc/man-sections/windows-options.rst +++ b/doc/man-sections/windows-options.rst @@ -179,6 +179,10 @@ :code:`exe` Call the route.exe shell command. + When OpenVPN is started by the interactive service, the service adds + the routes and a ``--route-method`` given in the configuration is + ignored. + --service args Should be used when OpenVPN is being automatically executed by another program in such a context that no interaction with the user via display diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 2068393..1a8604e 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2494,6 +2494,14 @@ options->ifconfig_noexec = false; } + /* the service adds the routes, --route-method must not override it */ + if (options->msg_channel && options->route_method != ROUTE_METHOD_SERVICE) + { + msg(M_WARN, "WARNING: ignoring --route-method, routes are added by the interactive service"); + options->route_method = ROUTE_METHOD_SERVICE; + } + + /* this depends on options->route_method, which is set above */ remap_redirect_gateway_flags(options); /* -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/2219?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4571033af79092d85657b176044497245faf5e39 Gerrit-Change-Number: 2219 Gerrit-PatchSet: 2 Gerrit-Owner: Heiko Hund <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Răzvan Cojocaru <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
