[Openvpn-devel,v1] options: let the interactive service add routes again
Commit Message
From: Heiko Hund <heiko@ist.eigentlich.net>
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 <heiko@ist.eigentlich.net>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
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 <razvanc@mailbox.org>
@@ -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
@@ -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);
/*