From 3051d7a5833eb8cd4903a5fec749549de27a3c8d Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Wed, 28 Nov 2012 10:52:45 +0100 Subject: corrected is_dir call in sftpd --- lib/ssh/src/ssh_sftpd.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/ssh/src') diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl index d6a7ee3859..21ba98a3e1 100644 --- a/lib/ssh/src/ssh_sftpd.erl +++ b/lib/ssh/src/ssh_sftpd.erl @@ -369,7 +369,8 @@ handle_op(?SSH_FXP_FSETSTAT, ReqId, <>, State0 = #state{file_handler = FileMod, file_state = FS0, xf = #ssh_xfer{vsn = Vsn}}) -> Path = relate_file_name(BPath, State0), - case FileMod:is_dir(Path) of %% This version 6 we still have ver 5 + {IsDir, _FS1} = FileMod:is_dir(Path, FS0), + case IsDir of %% This version 6 we still have ver 5 true when Vsn > 5 -> ssh_xfer:xf_send_status(State0#state.xf, ReqId, ?SSH_FX_FILE_IS_A_DIRECTORY, "File is a directory"); @@ -641,7 +642,8 @@ do_open(ReqId, State0, Path, Flags) -> #state{file_handler = FileMod, file_state = FS0, root = Root, xf = #ssh_xfer{vsn = Vsn}} = State0, XF = State0#state.xf, F = [binary | Flags], - case FileMod:is_dir(Path) of + {IsDir, _FS1} = FileMod:is_dir(Path, FS0), + case IsDir of true when Vsn > 5 -> ssh_xfer:xf_send_status(State0#state.xf, ReqId, ?SSH_FX_FILE_IS_A_DIRECTORY, "File is a directory"); -- cgit v1.2.3