Skip to content

Commit

Permalink
Merge pull request #5167 from HansN/hans/ssh/status_eaccess_fix/GH-5014
Browse files Browse the repository at this point in the history
…/OTP-17586

ssh: Handle eacces like enoent in ssh_sftpd:get_attrs/6
  • Loading branch information
HansN authored Sep 2, 2021
2 parents 7a40133 + 14c0f90 commit 7066955
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ssh/src/ssh_sftpd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,10 @@ get_attrs(RelPath, [F | Rest], FileMod, FS0, Vsn, Acc) ->
end,
Attrs = ssh_sftp:info_to_attr(Info),
get_attrs(RelPath, Rest, FileMod, FS1, Vsn, [{Name, Attrs} | Acc]);
{{error, enoent}, FS1} ->
{{error, Msg}, FS1} when
Msg == enoent ; % The item has disappeared after reading the list of items to check
Msg == eacces -> % You are not allowed to read this
%% Skip this F and check the remaining Rest
get_attrs(RelPath, Rest, FileMod, FS1, Vsn, Acc);
{Error, FS1} ->
{Error, FS1}
Expand Down

0 comments on commit 7066955

Please sign in to comment.