]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: turn assignment into assert check in call_trans2findfirst()
authorRalph Boehme <slow@samba.org>
Mon, 4 Jan 2021 15:09:43 +0000 (16:09 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jan 2021 11:30:38 +0000 (11:30 +0000)
The pathref fsp link destructor will set smb_dname->fsp to NULL. Turning this
into an assert to give a hint at readers of the code trying to understand the
mechanics.

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

index cdaf68c579aef4c7737f23767b98389cde1665cc..711c2aead4790fd599d16da5cfac93319ee54c7f 100644 (file)
@@ -2833,8 +2833,13 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da
         * correct path.
         */
        if (smb_dname->fsp != NULL) {
+               /*
+                * The pathref fsp link destructor will set smb_dname->fsp to
+                * NULL. Turning this into an assert to give a hint at readers
+                * of the code trying to understand the mechanics.
+                */
                file_free(req, smb_dname->fsp);
-               smb_dname->fsp = NULL;
+               SMB_ASSERT(smb_dname->fsp == NULL);
        }
 
        mask = get_original_lcomp(talloc_tos(),