summaryrefslogtreecommitdiff
path: root/src/leap/platform_init
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-07-09 22:57:35 +0900
committerKali Kaneko <kali@leap.se>2013-07-09 23:17:49 +0900
commit0319c7d5057df89db67f97d5085493eb31d5a817 (patch)
tree8dae6e72a5949e4bc62a91c9fe5f64714356ad9b /src/leap/platform_init
parent1c002eb9797107eb89540d70ca499c3a379d2bee (diff)
use cocoasudo for updown install
Diffstat (limited to 'src/leap/platform_init')
-rw-r--r--src/leap/platform_init/initializers.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/leap/platform_init/initializers.py b/src/leap/platform_init/initializers.py
index 5345f11a..0db48bb1 100644
--- a/src/leap/platform_init/initializers.py
+++ b/src/leap/platform_init/initializers.py
@@ -243,12 +243,9 @@ def _darwin_install_missing_scripts(badexec, notfound):
"openvpn")
launcher = vpnlaunchers.DarwinVPNLauncher
- # TODO should change osascript by use of the proper
- # os authorization api.
if os.path.isdir(installer_path):
fd, tempscript = tempfile.mkstemp(prefix="leap_installer-")
try:
- cmd = launcher.OSASCRIPT_BIN
scriptlines = launcher.cmd_for_missing_scripts(installer_path)
with os.fdopen(fd, 'w') as f:
f.write(scriptlines)
@@ -256,8 +253,9 @@ def _darwin_install_missing_scripts(badexec, notfound):
os.chmod(tempscript, st.st_mode | stat.S_IEXEC | stat.S_IXUSR |
stat.S_IXGRP | stat.S_IXOTH)
- osascript = launcher.OSX_ASADMIN % ("/bin/sh %s" % (tempscript,),)
- cmdline = ["%s -e '%s'" % (cmd, osascript)]
+ cmd, args = launcher().get_cocoasudo_installmissing_cmd()
+ args.append(tempscript)
+ cmdline = " ".join([cmd] + args)
ret = subprocess.call(
cmdline, stdout=subprocess.PIPE,
shell=True)