Client time cannot be compared to server timestamp, because the clocks
on client and server may not be in sync.
Compare server timestamps, only to previous timestamps read from server.
Signed-off-by: Amir Goldstein <amir@ctera.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Apr 1 06:23:36 UTC 2023 on atb-devel-224
NTTIME create_time;
NTTIME write_time;
NTTIME write_time2;
- struct timespec now;
- NTTIME send_close_time;
NTTIME close_time;
NTSTATUS status;
bool ret = true;
torture_comment(tctx, "Close file-handle 1\n");
sleep(2);
- now = timespec_current();
- send_close_time = full_timespec_to_nt_time(&now);
+ torture_comment(tctx, "Check writetime has been updated\n");
c = (struct smb2_close) {
.in.file.handle = h1,
ZERO_STRUCT(h1);
close_time = c.out.write_time;
- if (!(close_time > send_close_time)) {
+ if (!(close_time > write_time)) {
ret = false;
torture_fail_goto(tctx, done,
"Write-time not updated (wrong!)\n");