From 5388df783e4b60082113086ce6c94e47a841055f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Jul 2019 10:46:09 -0700 Subject: [PATCH] s3: smbd: Prepare for SMB1 directory handle opens in call_trans2findnext() Call close_file() on any SMB1 directory handle once the dptr is closed. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/trans2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5442187cad4..a2bad185475 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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) { -- 2.47.3