aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sftpd.erl
diff options
context:
space:
mode:
authorKristoffer Larsen <[email protected]>2019-01-04 13:15:35 +0100
committerKristoffer Larsen <[email protected]>2019-01-04 13:15:35 +0100
commit7b8c8ba289125a52d4dfca2da506e2063cb99d0e (patch)
tree75f5b5b452e431300096d9c9b2c22a550738aa19 /lib/ssh/src/ssh_sftpd.erl
parent9d5806b9215b733fdaa44c8be3c53fbdf3e8f7b0 (diff)
downloadotp-7b8c8ba289125a52d4dfca2da506e2063cb99d0e.tar.gz
otp-7b8c8ba289125a52d4dfca2da506e2063cb99d0e.tar.bz2
otp-7b8c8ba289125a52d4dfca2da506e2063cb99d0e.zip
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.
Diffstat (limited to 'lib/ssh/src/ssh_sftpd.erl')
-rw-r--r--lib/ssh/src/ssh_sftpd.erl7
1 files changed, 2 insertions, 5 deletions
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->
- <<?UINT32(BLen), BPath:BLen/binary>> = Data,
- stat(ReqId, unicode:characters_to_list(BPath), State, F);
-stat(Vsn, ReqId, Data, State, F) when Vsn >= 4->
- <<?UINT32(BLen), BPath:BLen/binary, ?UINT32(_Flags)>> = Data,
+stat(Vsn, ReqId, Data, State, F) ->
+ <<?UINT32(BLen), BPath:BLen/binary, _/binary>> = Data,
stat(ReqId, unicode:characters_to_list(BPath), State, F).
fstat(Vsn, ReqId, Data, State) when Vsn =< 3->