From 9133a8089ebf67e4d80ce98c0b4a5c45419029c2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 10 Aug 2016 17:20:32 +0200 Subject: [PATCH] HACK bug 12139 --- source3/smbd/close.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 1cb5460..f56db02 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -608,6 +608,7 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, NTSTATUS tmp; connection_struct *conn = fsp->conn; bool is_durable = false; + struct share_mode_lock *lck = NULL; if (fsp->num_aio_requests != 0) { @@ -735,6 +736,8 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, /* Remove the oplock before potentially deleting the file. */ if(fsp->oplock_type) { + lck = get_existing_share_mode_lock( + talloc_tos(), fsp->file_id); remove_oplock(fsp); } @@ -748,6 +751,8 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, status = ntstatus_keeperror(status, tmp); } + TALLOC_FREE(lck); + locking_close_file(conn->sconn->msg_ctx, fsp, close_type); tmp = fd_close(fsp); -- 2.1.4