diff options
author | Ingela Anderton Andin <[email protected]> | 2012-04-20 09:50:01 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-04-24 09:57:25 +0200 |
commit | b85e884f14e1dce52af7157045625f1ef5441ed1 (patch) | |
tree | 49dfd34d129927c7d07d0c42f1723e95d38399ec /lib/ssh/src/ssh_auth.erl | |
parent | a76628f8f0de895e318c11585a53983e476d692c (diff) | |
download | otp-b85e884f14e1dce52af7157045625f1ef5441ed1.tar.gz otp-b85e884f14e1dce52af7157045625f1ef5441ed1.tar.bz2 otp-b85e884f14e1dce52af7157045625f1ef5441ed1.zip |
Corrected ssh option handling
The option ip_v6_disabled and the undocumented option exec was incorrectly
handled by the option checking code.
There where two options for allowing user interaction one documented
and one undocumented, they where merge to to be the documented one.
For backwards compatibility the undocumented one is transformed to the
documented one in the option checking code.
Diffstat (limited to 'lib/ssh/src/ssh_auth.erl')
-rw-r--r-- | lib/ssh/src/ssh_auth.erl | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl index 1a4517c689..aa452a8e09 100644 --- a/lib/ssh/src/ssh_auth.erl +++ b/lib/ssh/src/ssh_auth.erl @@ -71,7 +71,7 @@ password_msg([#ssh{opts = Opts, io_cb = IoCb, ssh_bits:install_messages(userauth_passwd_messages()), Password = case proplists:get_value(password, Opts) of undefined -> - user_interaction(Opts, IoCb); + user_interaction(IoCb); PW -> PW end, @@ -89,13 +89,10 @@ password_msg([#ssh{opts = Opts, io_cb = IoCb, Ssh) end. -user_interaction(Opts, IoCb) -> - case proplists:get_value(allow_user_interaction, Opts, true) of - true -> - IoCb:read_password("ssh password: "); - false -> - not_ok - end. +user_interaction(ssh_no_io) -> + not_ok; +user_interaction(IoCb) -> + IoCb:read_password("ssh password: "). %% See RFC 4256 for info on keyboard-interactive @@ -124,8 +121,7 @@ init_userauth_request_msg(#ssh{opts = Opts} = Ssh) -> FirstAlg = algorithm(proplists:get_value(public_key_alg, Opts, ?PREFERRED_PK_ALG)), SecondAlg = other_alg(FirstAlg), - AllowUserInt = proplists:get_value(allow_user_interaction, Opts, - true), + AllowUserInt = proplists:get_value(user_interaction, Opts, true), Prefs = method_preference(FirstAlg, SecondAlg, AllowUserInt), ssh_transport:ssh_packet(Msg, Ssh#ssh{user = User, userauth_preference = Prefs, |