Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2219?usp=email
to review the following change.
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]>
---
M doc/man-sections/windows-options.rst
M src/openvpn/options.c
2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/2219/1
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);
/*
--
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: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4571033af79092d85657b176044497245faf5e39
Gerrit-Change-Number: 2219
Gerrit-PatchSet: 1
Gerrit-Owner: Heiko Hund <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel