From 0bcf30d0969334143de236dfd9e74fd804724126 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 1 Mar 2018 19:10:58 +0100 Subject: [bug] fix bitmask-root detection in snap --- src/leap/bitmask/vpn/helpers/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/leap/bitmask/vpn/helpers/__init__.py b/src/leap/bitmask/vpn/helpers/__init__.py index 3249456c..29e22e5d 100644 --- a/src/leap/bitmask/vpn/helpers/__init__.py +++ b/src/leap/bitmask/vpn/helpers/__init__.py @@ -1,8 +1,9 @@ +import os.path +import sys + from os import remove, chmod, access, R_OK from shutil import copyfile from hashlib import sha512 -import os.path -import sys from twisted.logger import Logger @@ -13,6 +14,8 @@ from leap.bitmask.util import STANDALONE log = Logger() +IS_SNAP = os.environ.get('SNAP') + if IS_LINUX: from leap.bitmask.vpn.constants import BITMASK_ROOT_SYSTEM @@ -70,6 +73,12 @@ if IS_LINUX: log.debug('Cannot read helpers') return True + if IS_SNAP: + if os.path.isfile(BITMASK_ROOT_LOCAL): + return True + log.error('cannot find bitmask-root in snap') + return False + helper_path_digest = digest(helper_path) if (_exists_and_can_read(BITMASK_ROOT_SYSTEM) and helper_path_digest == digest(BITMASK_ROOT_SYSTEM)): -- cgit v1.2.3