From 0f33c5f79f8bcdff0b159b153387383965c60efa Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 15 Aug 2013 11:19:24 -0300 Subject: Update leap.common minimum version needed. --- changes/bug-update-requirements | 1 + pkg/requirements.pip | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changes/bug-update-requirements diff --git a/changes/bug-update-requirements b/changes/bug-update-requirements new file mode 100644 index 00000000..e86e6e84 --- /dev/null +++ b/changes/bug-update-requirements @@ -0,0 +1 @@ + o Update leap.common minimum version needed. diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 042633a0..f533e521 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -17,7 +17,7 @@ twisted qt4reactor python-gnupg -leap.common>=0.2.5 +leap.common>=0.3.0 leap.soledad>=0.1.0 leap.keymanager>=0.2.0 -- cgit v1.2.3 From b4e7e9475c9aeaa768bc7c023efe2e96f463fe9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 15 Aug 2013 12:01:20 -0300 Subject: Add LEAPOPENVPN=1 command line env var to the vpnlauncher --- changes/bug_improve_openvpn_detection | 3 +++ src/leap/bitmask/services/eip/vpnlaunchers.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 changes/bug_improve_openvpn_detection diff --git a/changes/bug_improve_openvpn_detection b/changes/bug_improve_openvpn_detection new file mode 100644 index 00000000..99f43a07 --- /dev/null +++ b/changes/bug_improve_openvpn_detection @@ -0,0 +1,3 @@ + o Improve OpenVPN detection by searching for a specific leap-only + string in the command line. This makes it possible to run other + VPN instances while also using EIP. Fixes #3268 and #3364. \ No newline at end of file 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,)] -- cgit v1.2.3 From 1a105a07daa2c32243fb67bbacfc511d6014691e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 15 Aug 2013 12:01:45 -0300 Subject: Detect a running instance of EIP by checking for LEAPOPENVPN var --- src/leap/bitmask/services/eip/vpnprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py index 95ea2334..a96f176e 100644 --- a/src/leap/bitmask/services/eip/vpnprocess.py +++ b/src/leap/bitmask/services/eip/vpnprocess.py @@ -579,7 +579,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: -- cgit v1.2.3 From 3a0950e936dbe20a22f5809c46406d3a6b9ceffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 15 Aug 2013 12:02:08 -0300 Subject: Add an explicit comment about why we are using different poll_times --- src/leap/bitmask/services/eip/vpnprocess.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py index a96f176e..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 -- cgit v1.2.3