]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Prepare for SMB1 directory handle opens in call_trans2findnext()
authorJeremy Allison <jra@samba.org>
Wed, 17 Jul 2019 17:46:09 +0000 (10:46 -0700)
committerRalph Boehme <slow@samba.org>
Tue, 6 Aug 2019 14:23:33 +0000 (14:23 +0000)
Call close_file() on any SMB1 directory handle once the dptr is closed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/trans2.c

index 5442187cad46347e949cbb0cc12d269dfc717ccc..a2bad185475e21833bc94e5a08fb6ebf8e9594a1 100644 (file)
@@ -3143,6 +3143,7 @@ static void call_trans2findnext(connection_struct *conn,
        struct smbd_server_connection *sconn = req->sconn;
        bool backup_priv = false; 
        bool as_root = false;
+       files_struct *fsp = NULL;
 
        if (total_params < 13) {
                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -3434,7 +3435,12 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
        /* Check if we can close the dirptr */
        if(close_after_request || (finished && close_if_end)) {
                DEBUG(5,("call_trans2findnext: closing dptr_num = %d\n", dptr_num));
+               fsp = dptr_fsp(sconn, dptr_num);
                dptr_close(sconn, &dptr_num); /* This frees up the saved mask */
+               if (fsp != NULL) {
+                       close_file(NULL, fsp, NORMAL_CLOSE);
+                       fsp = NULL;
+               }
        }
 
        if (as_root) {