]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: close pathref fsp in call_trans2findfirst()
authorRalph Boehme <slow@samba.org>
Tue, 12 Jan 2021 11:50:43 +0000 (12:50 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jan 2021 11:30:38 +0000 (11:30 +0000)
Before freeing the fsp we have to close the handle.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/trans2.c

index 711c2aead4790fd599d16da5cfac93319ee54c7f..69b8323a29d8d0723282079fdc6d344c6e6958da 100644 (file)
@@ -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