From 31479d7781d3e566d9f6258016a13f349fe05389 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 Jul 2022 14:29:21 -0700 Subject: [PATCH] s3: smbd: In openat_pathref_dirfsp_nosymlink() ensure we call fsp_smb_fname_link() to set smb_fname->fsp in the returned smb_fname. Instead of just assigning smb_fname->fsp = fsp. This makes the logic match that of openat_pathref_fullname() and parent_pathref() when returning smb_fnames with associated pathref fsp's. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/smbd/files.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 5d8e292714f..9a81a16b3ec 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -944,7 +944,12 @@ next: goto nomem; } - result->fsp = fsp; + status = fsp_smb_fname_link(fsp, + &result->fsp_link, + &result->fsp); + if (!NT_STATUS_IS_OK(status)) { + goto fail; + } talloc_set_destructor(result, smb_fname_fsp_destructor); *_smb_fname = result; -- 2.47.3