summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/helpers
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-03-01 19:10:58 +0100
committerKali Kaneko <kali@leap.se>2018-03-02 03:54:21 +0100
commit0bcf30d0969334143de236dfd9e74fd804724126 (patch)
treeae1c7cb9a4dcb4440bdd01bfc356ba52cf83d99d /src/leap/bitmask/vpn/helpers
parent4d82a4252c9074dc4f5b5b1d7aa3a682b5571521 (diff)
[bug] fix bitmask-root detection in snap
Diffstat (limited to 'src/leap/bitmask/vpn/helpers')
-rw-r--r--src/leap/bitmask/vpn/helpers/__init__.py13
1 files 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)):