aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2010-05-26 14:38:02 +0000
committerErlang/OTP <[email protected]>2010-05-26 14:38:02 +0000
commit64943ba9de7ce7fa0ed75f9a6c3e7c472a07b8e0 (patch)
treef5991559f6b54c1b9209da7f54e1191055557f81 /lib/ssh
parent949935c134c1a74e077fbaed982fc59073635ecf (diff)
downloadotp-64943ba9de7ce7fa0ed75f9a6c3e7c472a07b8e0.tar.gz
otp-64943ba9de7ce7fa0ed75f9a6c3e7c472a07b8e0.tar.bz2
otp-64943ba9de7ce7fa0ed75f9a6c3e7c472a07b8e0.zip
Aligning error message with used version
Diffstat (limited to 'lib/ssh')
-rw-r--r--lib/ssh/src/ssh_sftpd.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl
index dc789092dd..da91817fd7 100644
--- a/lib/ssh/src/ssh_sftpd.erl
+++ b/lib/ssh/src/ssh_sftpd.erl
@@ -242,7 +242,8 @@ handle_op(?SSH_FXP_REALPATH, ReqId,
end;
handle_op(?SSH_FXP_OPENDIR, ReqId,
<<?UINT32(RLen), RPath:RLen/binary>>,
- State0 = #state{file_handler = FileMod, file_state = FS0}) ->
+ State0 = #state{xf = #ssh_xfer{vsn = Vsn},
+ file_handler = FileMod, file_state = FS0}) ->
RelPath = binary_to_list(RPath),
AbsPath = relate_file_name(RelPath, State0),
@@ -250,10 +251,14 @@ handle_op(?SSH_FXP_OPENDIR, ReqId,
{IsDir, FS1} = FileMod:is_dir(AbsPath, FS0),
State1 = State0#state{file_state = FS1},
case IsDir of
- false ->
+ false when Vsn > 5 ->
ssh_xfer:xf_send_status(XF, ReqId, ?SSH_FX_NOT_A_DIRECTORY,
"Not a directory"),
State1;
+ false ->
+ ssh_xfer:xf_send_status(XF, ReqId, ?SSH_FX_FAILURE,
+ "Not a directory"),
+ State1;
true ->
add_handle(State1, XF, ReqId, directory, {RelPath,unread})
end;