<div dir="ltr">Hello,<div><br></div><div>on Erlang R16B03 I've found that ssh_cli crushed with function_clause, when I trying connected by ssh to my ssh daemon. Error:</div><div>...</div><div><div>** {function_clause,[{proplists,get_value,</div>
<div> [user,{ok,[]},undefined],</div><div> [{file,"proplists.erl"},{line,225}]},</div><div> {ssh_cli,start_shell,2,[{file,"ssh_cli.erl"},{line,457}]},</div>
<div> {ssh_cli,handle_ssh_msg,2,</div><div> [{file,"ssh_cli.erl"},{line,107}]},</div><div> {ssh_channel,handle_info,2,</div><div> [{file,"ssh_channel.erl"},{line,241}]},</div>
<div> {gen_server,handle_msg,5,</div><div> [{file,"gen_server.erl"},{line,604}]},</div><div> {proc_lib,init_p_do_apply,3,</div><div> [{file,"proc_lib.erl"},{line,239}]}]}</div>
</div><div><br></div><div>Note: all error in the file error.</div><div><br></div><div>Steps to reproduce:</div><div>1. compile ssh_bug.erl</div><div>2. ssh_bug:test().</div><div>3. connect by ssh: ssh localhost -p9876</div>
<div>4. look at erlang concole for error.</div><div><br></div><div>The reason of the bug is getting ConnectionInfo in the ssh_cli. Instead of use ssh_connection_handler:connection_info method to get ConnectionInfo used ssh_connection_handler:info.</div>
<div><br></div><div>Patch for current bug:</div><div><div>452c452</div><div>< ConnectionInfo = ssh_connection_handler:info(ConnectionHandler,</div><div>---</div><div>> ConnectionInfo = ssh_connection_handler:connection_info(ConnectionHandler,</div>
<div>456c456</div><div>< {ok, User} =</div><div>---</div><div>> User =</div><div>462c462</div><div>< [{_, PeerAddr}] =</div><div>---</div><div>
> {_, PeerAddr} =</div><div>480c480</div><div>< ConnectionInfo = ssh_connection_handler:info(ConnectionHandler,</div><div>---</div><div>> ConnectionInfo = ssh_connection_handler:connection_info(ConnectionHandler,</div>
<div>482c482</div><div>< {ok, User} =</div><div>---</div><div>> User =</div><div>491c491</div><div>< [{_, PeerAddr}] =</div><div>---</div><div>> {_, PeerAddr} =</div></div><div>
<br></div><div><br></div><div>Sample, error and patch in the attach.</div><div><br></div></div>