From bcac1dab694be832c3f993356daacaee35c49f71 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 12 Jan 2021 12:50:43 +0100 Subject: [PATCH] s3:smbd: close pathref fsp in call_trans2findfirst() Before freeing the fsp we have to close the handle. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source3/smbd/trans2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 711c2aead47..69b8323a29d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2833,6 +2833,11 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da * correct path. */ if (smb_dname->fsp != NULL) { + ntstatus = fd_close(smb_dname->fsp); + if (!NT_STATUS_IS_OK(ntstatus)) { + reply_nterror(req, ntstatus); + goto out; + } /* * The pathref fsp link destructor will set smb_dname->fsp to * NULL. Turning this into an assert to give a hint at readers -- 2.47.2