mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Explicitly execute /bin/sh versus $SHELL because some folks have very incompatible/weird shells. We do not
execute modules through the shell, this is only for basic ops, so should be sufficient.
This commit is contained in:
@@ -71,7 +71,7 @@ class Connection(object):
|
||||
# the -p option.
|
||||
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
|
||||
prompt = '[sudo via ansible, key=%s] password: ' % randbits
|
||||
sudocmd = 'sudo -k && sudo -p "%s" -u %s "$SHELL" -c %s' % (
|
||||
sudocmd = 'sudo -k && sudo -p "%s" -u %s /bin/sh -c %s' % (
|
||||
prompt, sudo_user, pipes.quote(cmd))
|
||||
sudo_output = ''
|
||||
ssh_cmd.append(sudocmd)
|
||||
|
||||
Reference in New Issue
Block a user