diff options
author | Marcus Arendt <[email protected]> | 2014-08-28 10:33:53 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-08-28 10:33:53 +0200 |
commit | 94b7ece322468e30a3dda9e6c8aba57d62bdaac5 (patch) | |
tree | 63760326220f9852d95f0239d9d76dfc6636e4f3 /lib/ssh/src/ssh_cli.erl | |
parent | f5b36fc72e1ac37d00f82b7651b7ca06a628097f (diff) | |
parent | 76b79e88aaf4d59e8cb057fe9a075cc27f0c79c8 (diff) | |
download | otp-94b7ece322468e30a3dda9e6c8aba57d62bdaac5.tar.gz otp-94b7ece322468e30a3dda9e6c8aba57d62bdaac5.tar.bz2 otp-94b7ece322468e30a3dda9e6c8aba57d62bdaac5.zip |
Merge branch 'michaelkschmidt/ssh_bug_fix' into maint
* michaelkschmidt/ssh_bug_fix:
Test Other Clauses of start_shell
Fix SSH CLI when using custom "shell" option
Diffstat (limited to 'lib/ssh/src/ssh_cli.erl')
-rw-r--r-- | lib/ssh/src/ssh_cli.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl index 77453e8fd7..18841e3d2d 100644 --- a/lib/ssh/src/ssh_cli.erl +++ b/lib/ssh/src/ssh_cli.erl @@ -457,17 +457,17 @@ bin_to_list(I) when is_integer(I) -> start_shell(ConnectionHandler, State) -> Shell = State#state.shell, - ConnectionInfo = ssh_connection_handler:info(ConnectionHandler, + ConnectionInfo = ssh_connection_handler:connection_info(ConnectionHandler, [peer, user]), ShellFun = case is_function(Shell) of true -> - {ok, User} = + User = proplists:get_value(user, ConnectionInfo), case erlang:fun_info(Shell, arity) of {arity, 1} -> fun() -> Shell(User) end; {arity, 2} -> - [{_, PeerAddr}] = + {_, PeerAddr} = proplists:get_value(peer, ConnectionInfo), fun() -> Shell(User, PeerAddr) end; _ -> @@ -485,9 +485,9 @@ start_shell(_ConnectionHandler, Cmd, #state{exec={M, F, A}} = State) -> State#state{group = Group, buf = empty_buf()}; start_shell(ConnectionHandler, Cmd, #state{exec=Shell} = State) when is_function(Shell) -> - ConnectionInfo = ssh_connection_handler:info(ConnectionHandler, + ConnectionInfo = ssh_connection_handler:connection_info(ConnectionHandler, [peer, user]), - {ok, User} = + User = proplists:get_value(user, ConnectionInfo), ShellFun = case erlang:fun_info(Shell, arity) of @@ -496,7 +496,7 @@ start_shell(ConnectionHandler, Cmd, #state{exec=Shell} = State) when is_function {arity, 2} -> fun() -> Shell(Cmd, User) end; {arity, 3} -> - [{_, PeerAddr}] = + {_, PeerAddr} = proplists:get_value(peer, ConnectionInfo), fun() -> Shell(Cmd, User, PeerAddr) end; _ -> |