Commit 17be5537 by Michael DeHaan

When sudoing to another user, the umask may be set such that the next user might…

When sudoing to another user, the umask may be set such that the next user might not be able to read/execute
the file.  Deal with this.
parent fcdc281c
...@@ -210,7 +210,11 @@ class Runner(object): ...@@ -210,7 +210,11 @@ class Runner(object):
args = utils.jsonify(args,format=True) args = utils.jsonify(args,format=True)
(remote_module_path, is_new_style) = self._copy_module(conn, tmp, module_name, inject) (remote_module_path, is_new_style) = self._copy_module(conn, tmp, module_name, inject)
self._low_level_exec_command(conn, "chmod +x %s" % remote_module_path, tmp) cmd = "chmod +x %s" % remote_module_path
if self.sudo and self.sudo_user != 'root':
# deal with possible umask issues once sudo'ed to other user
cmd = "chmod 555 %s" % remote_module_path
self._low_level_exec_command(conn, cmd, tmp)
cmd = "" cmd = ""
if not is_new_style: if not is_new_style:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment