summaryrefslogtreecommitdiff
path: root/src/leap/platform_init
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-07-09 16:38:09 -0300
committerTomás Touceda <chiiph@leap.se>2013-07-09 16:38:09 -0300
commitdcade16e5e600d1eae1055a55cbe77d83a54763a (patch)
tree946eead15193248c8f7ca799e31be66b4bb3d50b /src/leap/platform_init
parent1c002eb9797107eb89540d70ca499c3a379d2bee (diff)
parenta78d603c063204d50fffa7d797e9c82e74471a79 (diff)
Merge remote-tracking branch 'kali/bug/3113_cocoasudo_install' into develop
Diffstat (limited to 'src/leap/platform_init')
-rw-r--r--src/leap/platform_init/initializers.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/leap/platform_init/initializers.py b/src/leap/platform_init/initializers.py
index 5345f11a..d22d7143 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)
@@ -307,13 +305,14 @@ def DarwinInitializer():
ret = msg.exec_()
if ret == QtGui.QMessageBox.Yes:
- installer_path = os.path.join(
- os.getcwd(),
- "..",
- "Resources",
- "tuntap-installer.app")
+ installer_path = os.path.abspath(
+ os.path.join(
+ os.getcwd(),
+ "..",
+ "Resources",
+ "tuntap-installer.app"))
if os.path.isdir(installer_path):
- cmd = ["open %s" % (installer_path,)]
+ cmd = ["open '%s'" % (installer_path,)]
try:
ret = subprocess.call(
cmd, stdout=subprocess.PIPE,