summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/launchers
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-04-03 02:45:34 +0200
committerRuben Pollan <meskio@sindominio.net>2018-04-11 16:40:10 +0200
commit3169015c5f5eaed5f2ad48e486b1fe96e1eb6bbe (patch)
tree6394836b65afb6be4768504474964e677c75210a /src/leap/bitmask/vpn/launchers
parent309ea9c35743c11dd29d809e713274840fb0b145 (diff)
several fixes for riseupvpn snap
- move snap folder to root folder, to allow automated builds - install only polkit file outside of snap - change path of bitmask-root accordingly in bitmask - fix check for polkit file inside snap - change and document the algorithm for picking bitmask-root in linux - add LD_LIBRARY_PATH as an environment entry for bitmask-systray
Diffstat (limited to 'src/leap/bitmask/vpn/launchers')
-rw-r--r--src/leap/bitmask/vpn/launchers/linux.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/leap/bitmask/vpn/launchers/linux.py b/src/leap/bitmask/vpn/launchers/linux.py
index 748fe858..db8ffce7 100644
--- a/src/leap/bitmask/vpn/launchers/linux.py
+++ b/src/leap/bitmask/vpn/launchers/linux.py
@@ -86,15 +86,16 @@ class LinuxVPNLauncher(VPNLauncher):
class BITMASK_ROOT(object):
def __call__(self):
-
current_version = self._version(_config.get_bitmask_helper_path())
_sys = constants.BITMASK_ROOT_SYSTEM
_sys_version = 0
_local = constants.BITMASK_ROOT_LOCAL
_local_version = 0
+ _snap = constants.BITMASK_ROOT_SNAP
+ _snap_version = 0
if IS_SNAP:
- return _local
+ return _snap
if os.path.isfile(_sys):
_sys_version = self._version(_sys)
@@ -182,13 +183,22 @@ class LinuxVPNLauncher(VPNLauncher):
openvpn_verb)
if IS_SNAP:
- return ["pkexec", "/usr/local/sbin/bitmask-root",
+ # cannot reference bitmask_root because 'local variable command
+ # referenced before assignment' XXX bug!
+ # this should change when bitmask is also a snap. for now,
+ # snap means RiseupVPN
+ return ["pkexec", constants.BITMASK_ROOT_SNAP,
"openvpn", "start"] + command
- command.insert(0, force_eval(kls.BITMASK_ROOT))
+ bitmask_root = force_eval(kls.BITMASK_ROOT)
+ command.insert(0, bitmask_root)
command.insert(1, "openvpn")
command.insert(2, "start")
+ # this is a workaround for integration tests, since it's not
+ # trivial to run polkit inside docker containers.
+ # however, you might want to run bitmask as root under certain
+ # environments, like embedded devices.
if os.getuid() != 0:
policyChecker = LinuxPolicyChecker()
pkexec = policyChecker.get_usable_pkexec()