diff options
author | Kali Kaneko <kali@leap.se> | 2013-12-10 15:59:24 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-12-10 15:59:24 -0400 |
commit | 5a4c47c4a3fb0c394c64000aa87dcece9b5ee990 (patch) | |
tree | ffd82d43d359f0ff36ae480ee22ce8843176dac1 /src/leap/bitmask/services | |
parent | 9a3a53c2681bb6351a2d58d0a5ac8628b374c60b (diff) | |
parent | 496036f15cf257d16b6594770812da64a249280c (diff) |
Merge tag '0.3.8' into debian-0.3.8
Tag leap.bitmask version 0.3.8
Diffstat (limited to 'src/leap/bitmask/services')
-rw-r--r-- | src/leap/bitmask/services/eip/eipconfig.py | 14 | ||||
-rw-r--r-- | src/leap/bitmask/services/eip/linuxvpnlauncher.py | 17 | ||||
-rw-r--r-- | src/leap/bitmask/services/eip/vpnlauncher.py | 3 | ||||
-rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 2 |
4 files changed, 24 insertions, 12 deletions
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py index 16ed4cc0..09a3d257 100644 --- a/src/leap/bitmask/services/eip/eipconfig.py +++ b/src/leap/bitmask/services/eip/eipconfig.py @@ -33,17 +33,25 @@ from leap.common.check import leap_assert, leap_assert_type logger = logging.getLogger(__name__) -def get_eipconfig_path(domain): +def get_eipconfig_path(domain, relative=True): """ - Returns relative path for EIP config. + Returns relative or absolute path for EIP config. :param domain: the domain to which this eipconfig belongs to. :type domain: str + :param relative: defines whether the path should be relative or absolute. + :type relative: bool :returns: the path :rtype: str """ leap_assert(domain is not None, "get_eipconfig_path: We need a domain") - return os.path.join("leap", "providers", domain, "eip-service.json") + + path = os.path.join("leap", "providers", domain, "eip-service.json") + + if not relative: + path = os.path.join(get_path_prefix(), path) + + return path def load_eipconfig_if_needed(provider_config, eip_config, domain): diff --git a/src/leap/bitmask/services/eip/linuxvpnlauncher.py b/src/leap/bitmask/services/eip/linuxvpnlauncher.py index d02f6f96..d24e7ae7 100644 --- a/src/leap/bitmask/services/eip/linuxvpnlauncher.py +++ b/src/leap/bitmask/services/eip/linuxvpnlauncher.py @@ -77,7 +77,7 @@ def _try_to_launch_agent(): Tries to launch a polkit daemon. """ env = None - if flags.STANDALONE is True: + if flags.STANDALONE: env = {"PYTHONPATH": os.path.abspath('../../../../lib/')} try: # We need to quote the command because subprocess call @@ -148,18 +148,21 @@ class LinuxVPNLauncher(VPNLauncher): def missing_other_files(kls): """ 'Extend' the VPNLauncher's missing_other_files to check if the polkit - files is outdated. If the polkit file that is in OTHER_FILES exists but - is not up to date, it is added to the missing list. + files is outdated, in the case of an standalone bundle. + If the polkit file that is in OTHER_FILES exists but is not up to date, + it is added to the missing list. :returns: a list of missing files :rtype: list of str """ # we use `super` in order to send the class to use missing = super(LinuxVPNLauncher, kls).missing_other_files() - polkit_file = LinuxPolicyChecker.get_polkit_path() - if polkit_file not in missing: - if privilege_policies.is_policy_outdated(kls.OPENVPN_BIN_PATH): - missing.append(polkit_file) + + if flags.STANDALONE: + polkit_file = LinuxPolicyChecker.get_polkit_path() + if polkit_file not in missing: + if privilege_policies.is_policy_outdated(kls.OPENVPN_BIN_PATH): + missing.append(polkit_file) return missing diff --git a/src/leap/bitmask/services/eip/vpnlauncher.py b/src/leap/bitmask/services/eip/vpnlauncher.py index 07497814..99cae7f9 100644 --- a/src/leap/bitmask/services/eip/vpnlauncher.py +++ b/src/leap/bitmask/services/eip/vpnlauncher.py @@ -147,7 +147,8 @@ class VPNLauncher(object): args = [] args += [ - '--setenv', "LEAPOPENVPN", "1" + '--setenv', "LEAPOPENVPN", "1", + '--nobind' ] if openvpn_verb is not None: diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index e8c7e9ce..d078ae96 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -196,7 +196,7 @@ class SoledadBootstrapper(AbstractBootstrapper): leap_assert(not sameProxiedObjects(self._soledad, None), "Null soledad, error while initializing") - self.deferred = deferToThread(self._do_soledad_sync) + self._do_soledad_sync() def _do_soledad_sync(self): """ |