From cd80db85f3ae8fc96475454dcec32c16543923ab Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 7 Jun 2024 19:35:47 +0100 Subject: [PATCH] HACKY fix for including dfs link(s) in direntries --- source3/smbd/files.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 046b58023bd..57222e0b75b 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -1305,7 +1305,22 @@ next: status = NT_STATUS_STOPPED_ON_SYMLINK; goto fail; } - + if ((fd == -1) && (errno == ELOOP) && S_ISLNK(fsp->fsp_name->st.st_ex_mode)) { + NTSTATUS prev = status; + status = read_symlink_reparse(mem_ctx, + dirfsp, + &rel_fname, + &symlink_err); + if (!NT_STATUS_IS_OK(status)) { + DBG_DEBUG("create_open_symlink_err failed: %s\n", + nt_errstr(status)); + status = prev; + goto fail; + } + DBG_ERR("about to return NT_STATUS_STOPPED_ON_SYMLINK\n"); + status = NT_STATUS_STOPPED_ON_SYMLINK; + goto fail; + } if (fd == -1) { status = map_nt_error_from_unix(errno); DBG_DEBUG("SMB_VFS_OPENAT() failed: %s\n", -- 2.35.3