smbd: remove initial stat() EACCES handling from unix_convert()
authorRalph Boehme <slow@samba.org>
Thu, 23 Apr 2020 08:48:51 +0000 (10:48 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 23 Apr 2020 19:50:38 +0000 (19:50 +0000)
This was added by bd90ca6f00b (my bad) but it breaks filesystems with NFS4
permissions.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 23 19:50:38 UTC 2020 on sn-devel-184

source3/smbd/filename.c

index 8030e50431720a6899d6cf4510411b9ff612cc75..1bf09053bbcb85065d9132c0100df6e9cf2d0f47 100644 (file)
@@ -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