summaryrefslogtreecommitdiff
path: root/src/leap/services/eip/vpnlaunchers.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-07-29 10:31:47 -0300
committerTomás Touceda <chiiph@leap.se>2013-07-29 10:31:47 -0300
commit0b02078c3b0de38103fb21294405422d4113177b (patch)
treebbee5abe3219f60b3dc87447b3aa8fbf8310cc62 /src/leap/services/eip/vpnlaunchers.py
parentea9700b4a74a9cd991701f3394d11804cdad44cb (diff)
parent53056ee3f1e1ad07495880ac9f02ed5755ff258f (diff)
Merge remote-tracking branch 'kali/feature/check_kext' into develop
Diffstat (limited to 'src/leap/services/eip/vpnlaunchers.py')
-rw-r--r--src/leap/services/eip/vpnlaunchers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py
index 81d9b43b..8522d1df 100644
--- a/src/leap/services/eip/vpnlaunchers.py
+++ b/src/leap/services/eip/vpnlaunchers.py
@@ -58,6 +58,10 @@ class EIPNoPkexecAvailable(VPNLauncherException):
pass
+class EIPNoTunKextLoaded(VPNLauncherException):
+ pass
+
+
class VPNLauncher:
"""
Abstract launcher class
@@ -520,6 +524,13 @@ class DarwinVPNLauncher(VPNLauncher):
to, frompath, to, to)
return cmd
+ @classmethod
+ def maybe_kextloaded(kls):
+ """
+ Checks if the needed kext is loaded before launching openvpn.
+ """
+ return bool(commands.getoutput('kextstat | grep "leap.tun"'))
+
def _get_resource_path(self):
"""
Returns the absolute path to the app resources directory
@@ -600,6 +611,9 @@ class DarwinVPNLauncher(VPNLauncher):
leap_assert(socket_host, "We need a socket host!")
leap_assert(socket_port, "We need a socket port!")
+ if not self.maybe_kextloaded():
+ raise EIPNoTunKextLoaded
+
kwargs = {}
if ProviderConfig.standalone:
kwargs['path_extension'] = os.path.join(