Merge pull request #276 from dw/issue271

ssh: Only match "permission denied" at start of line; closes #271.
pull/281/head
dw 6 years ago committed by GitHub
commit bf478b451b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -188,7 +188,10 @@ class Stream(mitogen.parent.Stream):
self._host_key_prompt()
elif HOSTKEY_FAIL in buf.lower():
raise HostKeyError(self.hostkey_failed_msg)
elif PERMDENIED_PROMPT in buf.lower():
elif buf.lower().startswith(PERMDENIED_PROMPT):
# issue #271: work around conflict with user shell reporting
# 'permission denied' e.g. during chdir($HOME) by only matching
# it at the start of the line.
if self.password is not None and password_sent:
raise PasswordError(self.password_incorrect_msg)
else:

Loading…
Cancel
Save