From ab018150e6822b0e5dd7b63e4449fe38b6b0ef01 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 29 May 2020 17:56:58 -0700 Subject: [PATCH] s3: VFS: default. Ensure read_dfs_pathat() returns stat info. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the knownfail.d/msdfs-attr file. Everything now passes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Jun 3 06:19:21 UTC 2020 on sn-devel-184 --- selftest/knownfail.d/msdfs-attr | 3 --- source3/modules/vfs_default.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 selftest/knownfail.d/msdfs-attr diff --git a/selftest/knownfail.d/msdfs-attr b/selftest/knownfail.d/msdfs-attr deleted file mode 100644 index a8a77ec2719..00000000000 --- a/selftest/knownfail.d/msdfs-attr +++ /dev/null @@ -1,3 +0,0 @@ -samba3.smbtorture_s3.smb2.MSDFS-ATTRIBUTE -samba3.smbtorture_s3.smb1.MSDFS-ATTRIBUTE - diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index f00255914f3..a4910b4882d 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -434,9 +434,15 @@ static NTSTATUS vfswrap_read_dfs_pathat(struct vfs_handle_struct *handle, #else char link_target_buf[7]; #endif + int ret; SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + if (is_named_stream(smb_fname)) { + status = NT_STATUS_OBJECT_NAME_NOT_FOUND; + goto err; + } + if (ppreflist == NULL && preferral_count == NULL) { /* * We're only checking if this is a DFS @@ -485,6 +491,14 @@ static NTSTATUS vfswrap_read_dfs_pathat(struct vfs_handle_struct *handle, goto err; } + ret = sys_lstat(smb_fname->base_name, + &smb_fname->st, + lp_fake_directory_create_times(SNUM(handle->conn))); + if (ret < 0) { + status = map_nt_error_from_unix(errno); + goto err; + } + if (ppreflist == NULL && preferral_count == NULL) { /* Early return for checking if this is a DFS link. */ return NT_STATUS_OK;