summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/services/eip/vpnlaunchers.py13
-rw-r--r--src/leap/bitmask/services/eip/vpnprocess.py5
2 files changed, 17 insertions, 1 deletions
diff --git a/src/leap/bitmask/services/eip/vpnlaunchers.py b/src/leap/bitmask/services/eip/vpnlaunchers.py
index 8a127ce9..31a1c17b 100644
--- a/src/leap/bitmask/services/eip/vpnlaunchers.py
+++ b/src/leap/bitmask/services/eip/vpnlaunchers.py
@@ -402,6 +402,10 @@ class LinuxVPNLauncher(VPNLauncher):
openvpn = first(openvpn_possibilities)
args = []
+ args += [
+ '--setenv', "LEAPOPENVPN", "1"
+ ]
+
pkexec = self.maybe_pkexec()
if pkexec:
args.append(openvpn)
@@ -658,6 +662,10 @@ class DarwinVPNLauncher(VPNLauncher):
openvpn = first(openvpn_possibilities)
args = [openvpn]
+ args += [
+ '--setenv', "LEAPOPENVPN", "1"
+ ]
+
if openvpn_verb is not None:
args += ['--verb', '%d' % (openvpn_verb,)]
@@ -825,6 +833,11 @@ class WindowsVPNLauncher(VPNLauncher):
openvpn = first(openvpn_possibilities)
args = []
+
+ args += [
+ '--setenv', "LEAPOPENVPN", "1"
+ ]
+
if openvpn_verb is not None:
args += ['--verb', '%d' % (openvpn_verb,)]
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py
index 95ea2334..a896b60c 100644
--- a/src/leap/bitmask/services/eip/vpnprocess.py
+++ b/src/leap/bitmask/services/eip/vpnprocess.py
@@ -229,6 +229,9 @@ class VPNManager(object):
"""
# Timers, in secs
+ # NOTE: We need to set a bigger poll time in OSX because it seems
+ # openvpn malfunctions when you ask it a lot of things in a short
+ # amount of time.
POLL_TIME = 2.5 if IS_MAC else 1.0
CONNECTION_RETRY_TIME = 1
@@ -579,7 +582,7 @@ class VPNManager(object):
# we need to be able to filter out arguments in the form
# --openvpn-foo, since otherwise we are shooting ourselves
# in the feet.
- if any(map(lambda s: s.startswith("openvpn"), p.cmdline)):
+ if any(map(lambda s: s.find("LEAPOPENVPN") != -1, p.cmdline)):
openvpn_process = p
break
except psutil.error.AccessDenied: