diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-13 18:17:43 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-13 18:17:43 +0200 |
commit | 6e3cced820964ddaa6df07fe9cb2de0c3b2d80b7 (patch) | |
tree | 6cd55348a7f6b34fbaaa54b4567277bf4d0ce0a3 /src/leap | |
parent | 84e6e46f15e5f7b0d779e017e8eaca8d0727df92 (diff) |
[feat] use openvpn in the path provided by homebrew as a fallback
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/bitmask/vpn/launchers/darwin.py | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/leap/bitmask/vpn/launchers/darwin.py b/src/leap/bitmask/vpn/launchers/darwin.py index 80cacc4..7da69ad 100644 --- a/src/leap/bitmask/vpn/launchers/darwin.py +++ b/src/leap/bitmask/vpn/launchers/darwin.py @@ -19,7 +19,6 @@ Darwin VPN launcher implementation. """ -import commands import getpass import os import socket @@ -90,33 +89,16 @@ class DarwinVPNLauncher(VPNLauncher): INSTALL_PATH_ESCAPED,) OPENVPN_BIN_PATH = "%s/Contents/Resources/%s" % (INSTALL_PATH, OPENVPN_BIN) + if not os.path.isfile(OPENVPN_BIN_PATH): + # let's try with the homebrew path + OPENVPN_BIN_PATH = '/usr/local/sbin/openvpn' OTHER_FILES = [] @classmethod def is_kext_loaded(kls): - """ - Checks if the needed kext is loaded before launching openvpn. - - :returns: True if kext is loaded, False otherwise. - :rtype: bool - """ - loaded = bool(commands.getoutput( - 'kextstat | grep "net.sf.tuntaposx.tun"')) - if not loaded: - logger.error("tuntaposx extension not loaded!") - return loaded - - @classmethod - def _get_icon_path(kls): - """ - Returns the absolute path to the app icon. - - :rtype: str - """ - resources_path = os.path.abspath( - os.path.join(os.getcwd(), "../../Contents/Resources")) - - return os.path.join(resources_path, "bitmask.tiff") + # latest versions do not need tuntap, so we're going to deprecate + # the kext checking. + True @classmethod def get_vpn_command(kls, vpnconfig, providerconfig, socket_host, |