From - Tue Jan 04 11:45:44 2000 Message-Id: <38716A64.3AE86050@valinux.com> From: Jeremy Allison To: Multiple recipients of list SAMBA-NTDOM Subject: Re: file dates changing MIME-Version: 1.0 Content-Transfer-Encoding: 7bit References: Date: Tue, 4 Jan 2000 13:44:02 +1100 Content-Type: text/plain; charset=us-ascii Here is a patch to the 2.0.6 codebase to fix this problem. Unfortunately we did not receive this patch in time for the 2.0.6 release. This fix will be in Samba 2.0.7. Regards, Jeremy Allison, Samba Team. -------------------cut here--------------------------------- --- /home/jeremy/tmp/samba-2.0.6/source/smbd/trans2.c Wed Nov 10 18:36:11 1999 +++ smbd/trans2.c Tue Dec 21 11:10:31 1999 @@ -1694,14 +1694,25 @@ case SMB_SET_FILE_BASIC_INFO: { + /* Patch to do this correctly from Paul Eggert . */ + 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 = MIN(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 -------------------cut here--------------------------------- -- -------------------------------------------------------- Buying an operating system without source is like buying a self-assembly Space Shuttle with no instructions. --------------------------------------------------------