diff options
author | Hans Nilsson <hans@erlang.org> | 2018-06-25 15:00:35 +0200 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2018-06-25 15:00:35 +0200 |
commit | 42901d90e4bdd44949a13488d228b77f0eda5aa9 (patch) | |
tree | 64f71539b2b6bb94c8815cd6c9615b5c0cdf41f5 /lib/ssh/src | |
parent | 3fa9e059f48534044033484aa612c1ff4a65bcf3 (diff) | |
parent | aa490b13a7f98e54c48fea3537f02614f1145ffc (diff) | |
download | otp-42901d90e4bdd44949a13488d228b77f0eda5aa9.tar.gz otp-42901d90e4bdd44949a13488d228b77f0eda5aa9.tar.bz2 otp-42901d90e4bdd44949a13488d228b77f0eda5aa9.zip |
Merge branch 'maint-20' into maint
* maint-20:
Updated OTP version
Prepare release
ssh: Report the signal name if there is an exit-signal to sftpd
ssh: Bug fix sftp error codes
ssh: Fix ssh_xfer decode_ATTR error for Vsn=4
syntax_tools: Fix a bug regarding reverting map types.
Conflicts:
OTP_VERSION
lib/inets/doc/src/notes.xml
lib/inets/vsn.mk
lib/ssh/doc/src/notes.xml
lib/ssh/vsn.mk
lib/syntax_tools/doc/src/notes.xml
lib/syntax_tools/vsn.mk
otp_versions.table
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh_sftp.erl | 13 | ||||
-rw-r--r-- | lib/ssh/src/ssh_sftpd.erl | 6 | ||||
-rw-r--r-- | lib/ssh/src/ssh_xfer.erl | 2 |
3 files changed, 15 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl index 6e720a47b7..1b2ba5a50b 100644 --- a/lib/ssh/src/ssh_sftp.erl +++ b/lib/ssh/src/ssh_sftp.erl @@ -798,13 +798,22 @@ handle_ssh_msg({ssh_cm, _, {signal, _, _}}, State) -> %% Ignore signals according to RFC 4254 section 6.9. {ok, State}; -handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, _, Error, _}}, +handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, Signal, Error0, _}}, State0) -> + Error = + case Error0 of + "" -> Signal; + _ -> Error0 + end, State = reply_all(State0, {error, Error}), {stop, ChannelId, State}; handle_ssh_msg({ssh_cm, _, {exit_status, ChannelId, Status}}, State0) -> - State = reply_all(State0, {error, {exit_status, Status}}), + State = + case State0 of + 0 -> State0; + _ -> reply_all(State0, {error, {exit_status, Status}}) + end, {stop, ChannelId, State}. %%-------------------------------------------------------------------- diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl index 7ee762dcee..278f6a9780 100644 --- a/lib/ssh/src/ssh_sftpd.erl +++ b/lib/ssh/src/ssh_sftpd.erl @@ -125,9 +125,9 @@ handle_ssh_msg({ssh_cm, _, {signal, _, _}}, State) -> %% Ignore signals according to RFC 4254 section 6.9. {ok, State}; -handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, _, Error, _}}, State) -> - Report = io_lib:format("Connection closed by peer ~n Error ~p~n", - [Error]), +handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, Signal, Error, _}}, State) -> + Report = io_lib:format("Connection closed by peer signal ~p~n Error ~p~n", + [Signal,Error]), error_logger:error_report(Report), {stop, ChannelId, State}; diff --git a/lib/ssh/src/ssh_xfer.erl b/lib/ssh/src/ssh_xfer.erl index e1680c120e..7bb9c2d101 100644 --- a/lib/ssh/src/ssh_xfer.erl +++ b/lib/ssh/src/ssh_xfer.erl @@ -734,7 +734,7 @@ decode_ATTR(Vsn, <<?UINT32(Flags), Tail/binary>>) -> {Type,Tail2} = if Vsn =< 3 -> {?SSH_FILEXFER_TYPE_UNKNOWN, Tail}; - Vsn >= 5 -> + true -> <<?BYTE(T), TL/binary>> = Tail, {T, TL} end, |