diff options
author | Hans Nilsson <hans@erlang.org> | 2021-08-26 15:44:44 +0200 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2021-08-30 13:57:17 +0200 |
commit | 14c0f904a2590465c0f5f2f49ad55039b49b22b7 (patch) | |
tree | 249aacfa4affe0bda76943a454a27d6d72f4fdd6 | |
parent | cc73e5065cbc230505135e241d38a070db8922af (diff) | |
download | erlang-14c0f904a2590465c0f5f2f49ad55039b49b22b7.tar.gz |
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} |