From 6c923bcd1e79c4d1559a466b0defdd7a28c91382 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 12 May 2021 19:53:38 +0200 Subject: [PATCH] smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when closing a modified file Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source3/smbd/close.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index cbb2d89446c..1b83bae580f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -923,6 +923,14 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp, fsp->op->global->durable = false; } + if (fsp->fsp_flags.modified) { + notify_fname(conn, + NOTIFY_ACTION_DIRLEASE_BREAK, + 0, + fsp->fsp_name, + fsp_get_smb2_lease(fsp)); + } + /* If this is an old DOS or FCB open and we have multiple opens on the same handle we only have one share mode. Ensure we only remove the share mode on the last close. */ -- 2.47.3