mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #4538 from mulby/gabe/arguments-sudo
Ensure non-root users can read arguments file when using sudo_user and non-standard modules
This commit is contained in:
commit
efe2a9fb1d
1 changed files with 5 additions and 0 deletions
|
@ -320,6 +320,11 @@ class Runner(object):
|
|||
else:
|
||||
argsfile = self._transfer_str(conn, tmp, 'arguments', args)
|
||||
|
||||
if self.sudo and self.sudo_user != 'root':
|
||||
# deal with possible umask issues once sudo'ed to other user
|
||||
cmd_args_chmod = "chmod a+r %s" % argsfile
|
||||
self._low_level_exec_command(conn, cmd_args_chmod, tmp, sudoable=False)
|
||||
|
||||
if async_jid is None:
|
||||
cmd = "%s %s" % (remote_module_path, argsfile)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue