From 6e3cced820964ddaa6df07fe9cb2de0c3b2d80b7 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 13 Jun 2017 18:17:43 +0200 Subject: [feat] use openvpn in the path provided by homebrew as a fallback --- src/leap/bitmask/vpn/launchers/darwin.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'src/leap/bitmask/vpn/launchers') 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, -- cgit v1.2.3