From 7b8c8ba289125a52d4dfca2da506e2063cb99d0e Mon Sep 17 00:00:00 2001 From: Kristoffer Larsen Date: Fri, 4 Jan 2019 13:15:35 +0100 Subject: Fix sftpd interop for SSH_FXP_STAT Some SFTP client's have been discover to claim one version of the protocol and send messages in a different version. In the spirit of Postel's law, we can for SSH_FXP_STAT, ignore the differences in the protocol, as we are not doing anything with the flags anyway. --- lib/ssh/src/ssh_sftpd.erl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/ssh/src/ssh_sftpd.erl') diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl index 278f6a9780..aa9ba0f9bb 100644 --- a/lib/ssh/src/ssh_sftpd.erl +++ b/lib/ssh/src/ssh_sftpd.erl @@ -508,11 +508,8 @@ close_our_file({_,Fd}, FileMod, FS0) -> FS1. %%% stat: do the stat -stat(Vsn, ReqId, Data, State, F) when Vsn =< 3-> - <> = Data, - stat(ReqId, unicode:characters_to_list(BPath), State, F); -stat(Vsn, ReqId, Data, State, F) when Vsn >= 4-> - <> = Data, +stat(Vsn, ReqId, Data, State, F) -> + <> = Data, stat(ReqId, unicode:characters_to_list(BPath), State, F). fstat(Vsn, ReqId, Data, State) when Vsn =< 3-> -- cgit v1.2.3