From 205acab580379e351222de4fa2879ea44f59fc05 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 23 Apr 2020 10:48:51 +0200 Subject: [PATCH] smbd: remove initial stat() EACCES handling from unix_convert() This was added by bd90ca6f00b (my bad) but it breaks filesystems with NFS4 permissions. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Apr 23 19:50:38 UTC 2020 on sn-devel-184 --- source3/smbd/filename.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 8030e504317..1bf09053bbc 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -700,17 +700,12 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, /* Stat failed - ensure we don't use it. */ SET_STAT_INVALID(smb_fname->st); - if (errno == EACCES) { - /* - * Early exit on access denied. Walking - * the path won't fix that. - */ - DBG_DEBUG("stat [%s]: %s\n", - smb_fname_str_dbg(smb_fname), - strerror(errno)); - status = NT_STATUS_ACCESS_DENIED; - goto fail; - } + /* + * Note: we must continue processing a path if we get EACCES + * from stat. With NFS4 permissions the file might be lacking + * READ_ATTR, but if the parent has LIST permissions we can + * resolve the path in the path traversal loop down below. + */ if (errno == ENOENT) { /* Optimization when creating a new file - only