summaryrefslogtreecommitdiff
path: root/src/leap/eip/config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-03 10:46:22 +0900
committerkali <kali@leap.se>2012-08-03 10:46:22 +0900
commit0bb8cca027ab32a54f6792ab1b1368e2f1845368 (patch)
treefbccda410e0df863e1d4f43a1ad10a90ad5f5525 /src/leap/eip/config.py
parent5c34052ef9261a47947e3e03616fe34b099b9fa4 (diff)
check also for a suitable polkit-authentication-agent running
fix #382.
Diffstat (limited to 'src/leap/eip/config.py')
-rw-r--r--src/leap/eip/config.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/leap/eip/config.py b/src/leap/eip/config.py
index 4577837a..9583720e 100644
--- a/src/leap/eip/config.py
+++ b/src/leap/eip/config.py
@@ -4,13 +4,18 @@ import os
import platform
from leap.util.fileutil import which, mkdir_p
-from leap.baseapp.permcheck import is_pkexec_in_system
+from leap.baseapp.permcheck import (is_pkexec_in_system,
+ is_auth_agent_running)
class EIPNoPkexecAvailable(Exception):
pass
+class EIPNoPolkitAuthAgentAvailable(Exception):
+ pass
+
+
def build_ovpn_options(daemon=False):
"""
build a list of options
@@ -34,6 +39,7 @@ def build_ovpn_options(daemon=False):
opts = []
opts.append('--persist-tun')
+ opts.append('--persist-key')
# set user and group
opts.append('--user')
@@ -104,9 +110,8 @@ def build_ovpn_command(config, debug=False):
if not is_pkexec_in_system():
raise EIPNoPkexecAvailable
- #TBD --
- #if not is_auth_agent_running()
- # raise EIPNoPolkitAuthAgentAvailable
+ if not is_auth_agent_running():
+ raise EIPNoPolkitAuthAgentAvailable
command.append('pkexec')