From 057071360f0dd3577ce3f0de9de0b29a157e33ed Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 6 Sep 2024 11:46:12 +0200 Subject: [PATCH] smbd: use get_deferred_open_message_state() in open_directory() "deferred" will be used in the function by a later commit... Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source3/smbd/open.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 925d23d1e1e..0ee0872d15a 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5160,6 +5160,7 @@ static NTSTATUS open_directory(connection_struct *conn, { struct smb_filename *smb_dname = fsp->fsp_name; bool dir_existed = VALID_STAT(smb_dname->st); + bool deferred = false; struct open_ntcreate_lock_state lck_state = {}; bool keep_locked = false; NTSTATUS status; @@ -5190,6 +5191,23 @@ static NTSTATUS open_directory(connection_struct *conn, create_disposition, file_attributes); + if (req == NULL) { + /* Ensure req == NULL means INTERNAL_OPEN_ONLY */ + SMB_ASSERT(oplock_request == INTERNAL_OPEN_ONLY); + } else { + /* And req != NULL means no INTERNAL_OPEN_ONLY */ + SMB_ASSERT((oplock_request & INTERNAL_OPEN_ONLY) == 0); + } + + if (req != NULL) { + struct deferred_open_record *open_rec = NULL; + + deferred = get_deferred_open_message_state(req, NULL, &open_rec); + if (deferred) { + remove_deferred_open_message_smb(req->xconn, req->mid); + } + } + status = smbd_calculate_access_mask_fsp(parent_dir_fname->fsp, smb_dname->fsp, false, -- 2.11.4.GIT