From: Ralph Boehme Date: Sun, 15 Mar 2020 07:30:21 +0000 (+0100) Subject: smbd: let mark_file_modified() always call trigger_write_time_update() X-Git-Tag: samba-4.11.9~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8b5d996ec77704835c59f4b2cd8190c31df98c2;p=thirdparty%2Fsamba.git smbd: let mark_file_modified() always call trigger_write_time_update() Preperatory change: the next commit will reset fsp->update_write_time_on_close in the event handler, so this change ensures it gets set again for any subsequent write. This will NOT always result in a write-time update because trigger_write_time_update() has its own only-once logic using the internal variable fsp->update_write_time_triggered. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14320 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 53de2da7acfc24513082190502d93306c12b7434) --- diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index fa1c884f617..8e3412613d0 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -277,14 +277,14 @@ void mark_file_modified(files_struct *fsp) { int dosmode; + trigger_write_time_update(fsp); + if (fsp->modified) { return; } fsp->modified = true; - trigger_write_time_update(fsp); - if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) { return; }