1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

*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 8f93c08881)
This commit is contained in:
Jeremy Allison 1999-12-20 21:46:41 +00:00
parent ce394449c7
commit 80a180853d

View File

@ -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