diff options
Diffstat (limited to 'src/leap/platform_init')
-rw-r--r-- | src/leap/platform_init/initializers.py | 21 |
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, |