sshaskpass: disable echo more aggressively

Summary: Disable echo for "Enter passphrase for key".

Reviewed By: phillco

Differential Revision: D7592208

fbshipit-source-id: 79afb7bb49d952239571c1ddb8d3f5c32071d49b
This commit is contained in:
Jun Wu 2018-04-11 15:57:17 -07:00 committed by Saurabh Singh
parent 4affcfaa2a
commit 8e1acfaaa4

View File

@ -220,7 +220,11 @@ def _shoulddisableecho(prompt):
# we don't have the "flag" information from openssh's
# read_passphrase(const char *prompt, int flags).
# guess from the prompt string.
return prompt.find('assword:') >= 0
# do not match "Passcode or option"
if 'Passcode or option' in prompt:
return False
# match "password", "Password", "passphrase", "Passphrase".
return prompt.find('ass') >= 0
def _sshaskpassmain(prompt):
"""the ssh-askpass client"""