]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Prepare for SMB1 directory handle opens in reply_fclose()
authorJeremy Allison <jra@samba.org>
Wed, 17 Jul 2019 17:40:51 +0000 (10:40 -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/reply.c

index 4fb35a485dddc48644c7f8725e6ad91ab2ad3236..bd2f56772e896d4d9dbc691586aed2fabbd01273 100644 (file)
@@ -2083,6 +2083,7 @@ void reply_fclose(struct smb_request *req)
        bool path_contains_wcard = False;
        TALLOC_CTX *ctx = talloc_tos();
        struct smbd_server_connection *sconn = req->sconn;
+       files_struct *fsp = NULL;
 
        START_PROFILE(SMBfclose);
 
@@ -2126,8 +2127,13 @@ void reply_fclose(struct smb_request *req)
        memcpy(status,p,21);
 
        if(dptr_fetch(sconn, status+12,&dptr_num)) {
+               fsp = dptr_fsp(sconn, dptr_num);
                /*  Close the dptr - we know it's gone */
                dptr_close(sconn, &dptr_num);
+               if (fsp != NULL) {
+                       close_file(NULL, fsp, NORMAL_CLOSE);
+                       fsp = NULL;
+               }
        }
 
        reply_outbuf(req, 1, 0);