From: Heiko Hund <[email protected]> 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2219 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <[email protected]> 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 947439d..09a9d522 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); /* _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
