Fixes #5030 compare connection user and sudo user and disable sudo if identical

pull/5088/head
James Tanner 11 years ago
parent 12ed39ef7b
commit b6879ca2bd

@ -763,7 +763,9 @@ class Runner(object):
sudo_user = self.sudo_user
if self.remote_user == sudo_user:
# compare connection user to sudo_user and disable if the same
if hasattr(conn, 'user'):
if conn.user == sudo_user:
sudoable = False
rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)

Loading…
Cancel
Save