diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-07-30 10:01:57 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-07-30 10:19:31 -0300 |
commit | b655c0ab05bf55e62e2f27174b34ca63fe45431b (patch) | |
tree | dbdddd03aee4c3f7b3e779750edc5d3ec4755d17 /src/leap/services | |
parent | 4a8b4afd158076d63aac75e1014071ee340da12b (diff) |
Refactor cmd and add permission change.
The polkit file should be readable by everyone, so we can check its
contents without asking for permission.
Diffstat (limited to 'src/leap/services')
-rw-r--r-- | src/leap/services/eip/vpnlaunchers.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py index 7f66275d..b591b3ca 100644 --- a/src/leap/services/eip/vpnlaunchers.py +++ b/src/leap/services/eip/vpnlaunchers.py @@ -291,11 +291,13 @@ class LinuxVPNLauncher(VPNLauncher): :rtype: str """ to = kls.SYSTEM_CONFIG - cmd = "#!/bin/sh\nset -e\nmkdir -p %s\n" - cmd = (cmd + "cp %s/%s %s\ncp \"%s\" \"%s\"") % ( - to, - frompath, kls.UP_DOWN_FILE, to, - pol_file, kls.POLKIT_PATH) + + cmd = '#!/bin/sh\nset -e\n' + cmd += 'mkdir -p "%s"\n' % (to, ) + cmd += 'cp "%s/%s" "%s"\n' % (frompath, kls.UP_DOWN_FILE, to) + cmd += 'cp "%s" "%s"\n' % (pol_file, kls.POLKIT_PATH) + cmd += 'chmod 644 "%s"\n' % (kls.POLKIT_PATH, ) + return cmd @classmethod |