diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-04-13 13:30:06 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-04-13 13:30:06 +0000 |
commit | 7897bf73679a8fb85790ed093d75119c3a9c75fa (patch) | |
tree | 09a5ecc6b5c978e10a0cc759b4e6b94c32c8ea8a | |
parent | 81408df9cf23c50756deb3b61c9e00fb762edd60 (diff) | |
download | samba-7897bf73679a8fb85790ed093d75119c3a9c75fa.tar.gz samba-7897bf73679a8fb85790ed093d75119c3a9c75fa.tar.bz2 samba-7897bf73679a8fb85790ed093d75119c3a9c75fa.zip |
two time handling bugfixes
- the pending mtime overrides the current file time in setfileinfo
- a later wtime can override a mtime on setfileinfo
this fixes the date of file copies in win2000
(This used to be commit 79630bb2c0a99c961a0a1c67223899e39685ee2c)
-rw-r--r-- | source3/smbd/trans2.c | 10 |
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) { |