summaryrefslogtreecommitdiffstats
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1999-12-20 21:46:41 +0000
committerJeremy Allison <jra@samba.org>1999-12-20 21:46:41 +0000
commit80a180853d2d177f5c991a36e4b86943d9efa3fe (patch)
tree26d0dd730a03a6f0ce206f546eaff3dfeecd79a3 /source3/smbd/trans2.c
parentce394449c7923b815946d53a1059b04847abed02 (diff)
downloadsamba-80a180853d2d177f5c991a36e4b86943d9efa3fe.tar.gz
samba-80a180853d2d177f5c991a36e4b86943d9efa3fe.tar.xz
samba-80a180853d2d177f5c991a36e4b86943d9efa3fe.zip
*Finally*. Correct patch to fix timestamp problems from Paul Eggert <eggert@twinsun.com>.
I wish I had written this one :-). Jeremy. (This used to be commit 8f93c08881c22d121c7337d11de070e2b8f7ba33)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index e971f8bbb68..5a8db7efdac 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1694,14 +1694,25 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
case SMB_SET_FILE_BASIC_INFO:
{
+ /* Patch to do this correctly from Paul Eggert <eggert@twinsun.com>. */
+ time_t write_time;
+ time_t changed_time;
+
/* Ignore create time at offset pdata. */
/* access time */
tvs.actime = interpret_long_date(pdata+8);
- /* write time + changed time, combined. */
- tvs.modtime=MIN(interpret_long_date(pdata+16),
- interpret_long_date(pdata+24));
+ write_time = interpret_long_date(pdata+16);
+ changed_time = interpret_long_date(pdata+24);
+
+ tvs.modtime = MAX(write_time, changed_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
+ ? changed_time
+ : write_time);
#if 0 /* Needs more testing... */
/* Test from Luke to prevent Win95 from