diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-05 17:31:37 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-07 12:31:25 +0200 |
commit | 05f2b9d2b72139df56f67e88aeb7ceb6d8ec4e69 (patch) | |
tree | 6fce3da1defff38fe799321e3adfa7bc56537295 /src/leap/bitmask/vpn/launchers | |
parent | 1c418514c6f3ea57570023833ef66d2c9d3473f2 (diff) |
[feature] run vpn directly if user is root
- Improve tests too: add entry in resolv.conf, not done without
resolvconf
Diffstat (limited to 'src/leap/bitmask/vpn/launchers')
-rw-r--r-- | src/leap/bitmask/vpn/launchers/linux.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/bitmask/vpn/launchers/linux.py b/src/leap/bitmask/vpn/launchers/linux.py index d68d6ef1..00423ab8 100644 --- a/src/leap/bitmask/vpn/launchers/linux.py +++ b/src/leap/bitmask/vpn/launchers/linux.py @@ -99,10 +99,11 @@ class LinuxVPNLauncher(VPNLauncher): command.insert(1, "openvpn") command.insert(2, "start") - policyChecker = LinuxPolicyChecker() - pkexec = policyChecker.maybe_pkexec() - if pkexec: - command.insert(0, first(pkexec)) + if os.getuid() != 0: + policyChecker = LinuxPolicyChecker() + pkexec = policyChecker.maybe_pkexec() + if pkexec: + command.insert(0, first(pkexec)) return command |