diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-09-18 19:53:17 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-09-20 17:56:49 +0200 |
commit | 79e9f3c69b4eb061490d6a12a52888abc429542e (patch) | |
tree | bab13194d73dc75218a1575d52888c0f563e508c /src/leap/bitmask/vpn/privilege.py | |
parent | d0e4444555df79978aed5cd6c9548e2fd1c63936 (diff) |
[feat] detect if pkexec is present in the system
Check it before starting the vpn.
- Resolves: #8895
Diffstat (limited to 'src/leap/bitmask/vpn/privilege.py')
-rw-r--r-- | src/leap/bitmask/vpn/privilege.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/leap/bitmask/vpn/privilege.py b/src/leap/bitmask/vpn/privilege.py index 458f690..dd8d29a 100644 --- a/src/leap/bitmask/vpn/privilege.py +++ b/src/leap/bitmask/vpn/privilege.py @@ -109,7 +109,7 @@ class LinuxPolicyChecker(object): :returns: a list of the paths where pkexec is to be found :rtype: list """ - if not self._is_pkexec_in_system(): + if not is_pkexec_in_system(): log.warn('System has no pkexec') raise NoPkexecAvailable() @@ -181,12 +181,12 @@ class LinuxPolicyChecker(object): return is_running - @classmethod - def _is_pkexec_in_system(self): - """ - Checks the existence of the pkexec binary in system. - """ - pkexec_path = which('pkexec') - if len(pkexec_path) == 0: - return False - return True + +def is_pkexec_in_system(): + """ + Checks the existence of the pkexec binary in system. + """ + pkexec_path = which('pkexec') + if len(pkexec_path) == 0: + return False + return True |