ssh: Fix password authentication with Python 3.x & OpenSSH 7.5+

Since PERMDENIED_PROMPT is a byte string the interpolation was resulting
in: b"user@host: b'permission denied'". Needless to say this didn't
match.
pull/385/head
Alex Willmer 6 years ago
parent 67f26434cb
commit b9112a9cbb

@ -291,8 +291,8 @@ class Stream(mitogen.parent.Stream):
raise HostKeyError(self.hostkey_failed_msg) raise HostKeyError(self.hostkey_failed_msg)
elif buf.lower().startswith(( elif buf.lower().startswith((
PERMDENIED_PROMPT, PERMDENIED_PROMPT,
b("%s@%s: %s" % (self.username, self.hostname, b("%s@%s: " % (self.username, self.hostname))
PERMDENIED_PROMPT)), + PERMDENIED_PROMPT,
)): )):
# issue #271: work around conflict with user shell reporting # issue #271: work around conflict with user shell reporting
# 'permission denied' e.g. during chdir($HOME) by only matching # 'permission denied' e.g. during chdir($HOME) by only matching

Loading…
Cancel
Save