The branch, master has been updated
via bd90ca6f00b smbd: let unix_convert() fail early if initial stat
fails with EACCES
from fa1087bc5a9 s3: VFS: widelinks. Change call to
resolve_realpath_name() -> canonicalize_absolute_path().
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit bd90ca6f00b329e23100e8305fa461d452cf4651
Author: Ralph Boehme <[email protected]>
Date: Wed Apr 22 15:13:04 2020 +0200
smbd: let unix_convert() fail early if initial stat fails with EACCES
Doing directory scans on the path components is not going to change this, so
give up early. No change in behaviour, as we would just fail later in
get_real_filename() otherwise.
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Wed Apr 22 21:08:39 UTC 2020 on sn-devel-184
-----------------------------------------------------------------------
Summary of changes:
source3/smbd/filename.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Changeset truncated at 500 lines:
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 9faff9da45a..8030e504317 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -700,6 +700,18 @@ 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;
+ }
+
if (errno == ENOENT) {
/* Optimization when creating a new file - only
the last component doesn't exist.
--
Samba Shared Repository