diff options
author | Kali Kaneko <kali@leap.se> | 2017-10-07 00:51:13 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-10-09 17:14:25 +0200 |
commit | ff1d9805b71cf3d0e74724cdd89ebb1537cffbba (patch) | |
tree | a360eec5bd6dfde953da87950fd10fa494e34337 /src/leap/bitmask/vpn/launchers | |
parent | 2d58e0e8e04404b5e7ed9ce1c2165b428586fb94 (diff) |
[bug] properly check for local openvpn path
- Resolves: #9099
Diffstat (limited to 'src/leap/bitmask/vpn/launchers')
-rw-r--r-- | src/leap/bitmask/vpn/launchers/linux.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/leap/bitmask/vpn/launchers/linux.py b/src/leap/bitmask/vpn/launchers/linux.py index 052040dc..bff2d8cb 100644 --- a/src/leap/bitmask/vpn/launchers/linux.py +++ b/src/leap/bitmask/vpn/launchers/linux.py @@ -29,6 +29,7 @@ from twisted.logger import Logger from leap.bitmask.util import STANDALONE from leap.bitmask.vpn.utils import first, force_eval +from leap.bitmask.vpn import constants from leap.bitmask.vpn.privilege import LinuxPolicyChecker from leap.bitmask.vpn.management import ManagementProtocol from leap.bitmask.vpn.launcher import VPNLauncher @@ -84,10 +85,10 @@ class LinuxVPNLauncher(VPNLauncher): class BITMASK_ROOT(object): def __call__(self): - _global = '/usr/sbin/bitmask-root' - _local = '/usr/local/sbin/bitmask-root' - if os.path.isfile(_global): - return _global + _sys = constants.BITMASK_ROOT_SYSTEM + _local = constants.BITMASK_ROOT_LOCAL + if os.path.isfile(_sys): + return _sys elif os.path.isfile(_local): return _local else: @@ -95,8 +96,16 @@ class LinuxVPNLauncher(VPNLauncher): class OPENVPN_BIN_PATH(object): def __call__(self): - return ("/usr/local/sbin/leap-openvpn" if STANDALONE else - "/usr/sbin/openvpn") + _sys = constants.OPENVPN_SYSTEM + _local = constants.OPENVPN_LOCAL + # XXX this implies that, for the time being, we prefer the system + # openvpn if there is any. We assume that the system is kept + # up-to-date, since we still do not have a safe way of upgrading + # the bundle binaries. See #9101 + if os.path.exists(_sys): + return _sys + else: + return _local class POLKIT_PATH(object): def __call__(self): |