fix quoting for become commands

fixes #11808
This commit is contained in:
Brian Coca 2015-08-03 18:48:49 -04:00
parent ca941ec632
commit 015b922c1f

View file

@ -336,7 +336,6 @@ class PlayContext(Base):
becomecmd = None becomecmd = None
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32)) randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
success_key = 'BECOME-SUCCESS-%s' % randbits success_key = 'BECOME-SUCCESS-%s' % randbits
#executable = executable or '$SHELL'
success_cmd = pipes.quote('echo %s; %s' % (success_key, cmd)) success_cmd = pipes.quote('echo %s; %s' % (success_key, cmd))
if self.become_method == 'sudo': if self.become_method == 'sudo':
@ -381,7 +380,7 @@ class PlayContext(Base):
self.prompt = prompt self.prompt = prompt
self.success_key = success_key self.success_key = success_key
return ('%s -c ' % executable) + pipes.quote(becomecmd) return ('%s -c %s' % (executable, pipes.quote(becomecmd)))
return cmd return cmd