diff options
author | Hans Nilsson <[email protected]> | 2018-11-01 14:44:44 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-11-19 17:23:34 +0100 |
commit | 709534a5417f20f8edda1d3664669ed9d3129354 (patch) | |
tree | 17728bbbe04b165a2c3690cbcc270c5621365671 /lib/ssh/src | |
parent | 4c3e66d5969e1abe2c8827b756edd860555038a8 (diff) | |
download | otp-709534a5417f20f8edda1d3664669ed9d3129354.tar.gz otp-709534a5417f20f8edda1d3664669ed9d3129354.tar.bz2 otp-709534a5417f20f8edda1d3664669ed9d3129354.zip |
ssh: Generalize unpublished test support option
Also rename the corresponding testcase in ssh_options_SUITE and add logging.
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh.hrl | 7 | ||||
-rw-r--r-- | lib/ssh/src/ssh_auth.erl | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl index aa4b3ef098..3e9b1add3b 100644 --- a/lib/ssh/src/ssh.hrl +++ b/lib/ssh/src/ssh.hrl @@ -240,7 +240,12 @@ | ?COMMON_OPTION . -type opaque_client_options() :: - {keyboard_interact_fun, fun((term(),term(),term()) -> term())} + {keyboard_interact_fun, fun((Name::iodata(), + Instruction::iodata(), + Prompts::[{Prompt::iodata(),Echo::boolean()}] + ) -> + [Response::iodata()] + )} | opaque_common_options(). -type host_accepting_client_options() :: diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl index 1972468b8b..9632168e65 100644 --- a/lib/ssh/src/ssh_auth.erl +++ b/lib/ssh/src/ssh_auth.erl @@ -592,11 +592,11 @@ prompt_user_for_passwords(Name, Instr, PromptInfos, Opts) -> PromptInfos). keyboard_interact_fun(KbdInteractFun, Name, Instr, PromptInfos) -> - Prompts = lists:map(fun({Prompt,_Echo}) -> Prompt end, PromptInfos), - case KbdInteractFun(Name, Instr, Prompts) of - Rs when length(Rs) == length(PromptInfos) -> - Rs; - _Rs -> + case KbdInteractFun(Name, Instr, PromptInfos) of + Responses when is_list(Responses), + length(Responses) == length(PromptInfos) -> + Responses; + _ -> nok end. |