summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index adae7e0b3c..b46d1e930c 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2049,6 +2049,11 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
SSVAL(params,0,0);
+ if (fsp) {
+ /* the pending modtime overrides the current modtime */
+ sbuf.st_mtime = fsp->pending_modtime;
+ }
+
size = sbuf.st_size;
tvs.modtime = sbuf.st_mtime;
tvs.actime = sbuf.st_atime;
@@ -2110,6 +2115,9 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
tvs.modtime = MIN(write_time, changed_time);
+ if (write_time > tvs.modtime && write_time != 0xffffffff) {
+ tvs.modtime = write_time;
+ }
/* Prefer a defined time to an undefined one. */
if (tvs.modtime == (time_t)0 || tvs.modtime == (time_t)-1)
tvs.modtime = (write_time == (time_t)0 || write_time == (time_t)-1
@@ -2264,7 +2272,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
* NT does this a lot. It's actually pointless
* setting the time here, as it will be overwritten
* on the next write, so we save the request
- * away and will set it on file code. JRA.
+ * away and will set it on file close. JRA.
*/
if (tvs.modtime != (time_t)0 && tvs.modtime != (time_t)-1) {