From: Ralph Boehme Date: Wed, 12 May 2021 17:53:38 +0000 (+0200) Subject: smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when closing a modified file X-Git-Tag: tdb-1.4.13~701 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c923bcd1e79c4d1559a466b0defdd7a28c91382;p=thirdparty%2Fsamba.git smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when closing a modified file Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- 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. */