diff options
author | Hans Nilsson <hans@erlang.org> | 2021-09-02 13:03:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 13:03:49 +0200 |
commit | 7066955f3b33819ddc8c2e9f1361fd5020754dab (patch) | |
tree | 9a9a5205d5ac66478213a5742e0ff00a453467d7 | |
parent | 7a40133b042847968e184a4c6eaddd37dd275b5f (diff) | |
parent | 14c0f904a2590465c0f5f2f49ad55039b49b22b7 (diff) | |
download | erlang-7066955f3b33819ddc8c2e9f1361fd5020754dab.tar.gz |
Merge pull request #5167 from HansN/hans/ssh/status_eaccess_fix/GH-5014/OTP-17586
ssh: Handle eacces like enoent in ssh_sftpd:get_attrs/6
-rw-r--r-- | lib/ssh/src/ssh_sftpd.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl index 1c53690ed0..2d755e874a 100644 --- a/lib/ssh/src/ssh_sftpd.erl +++ b/lib/ssh/src/ssh_sftpd.erl @@ -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} |