From: Uri Simchoni Date: Sun, 19 Nov 2017 17:13:26 +0000 (+0000) Subject: s4-torture: fix file time checks X-Git-Tag: talloc-2.1.11~409 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a83953a094f1a41f3633ae24cdfd3a6cb804d986;p=thirdparty%2Fsamba.git s4-torture: fix file time checks NTTIME is an unsigned quantity. When comparing two of them, first calculate a signed difference, then take absolute value. Signed-off-by: Uri Simchoni Reviewed-by: Andrew Bartlett --- diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index c3cb4841339..44b04acda9a 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -112,7 +112,7 @@ static const char *rdwr_string(enum rdwr_mode m) status = smb_raw_pathinfo(cli->tree, tctx, &finfo); \ CHECK_STATUS(status, NT_STATUS_OK); \ t2 = finfo.all_info.out.field; \ - if (abs(t-t2) > 20000) { \ + if (llabs((int64_t)(t-t2)) > 20000) { \ torture_result(tctx, TORTURE_FAIL, \ "(%s) wrong time for field %s %s - %s\n", \ __location__, #field, \ diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index 397c07516dd..ead56eb5c40 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -81,7 +81,7 @@ status = smb2_getinfo_file(tree, tctx, &finfo); \ CHECK_STATUS(status, NT_STATUS_OK); \ t2 = finfo.all_info.out.field; \ - if (abs(t-t2) > 20000) { \ + if (llabs((int64_t)(t-t2)) > 20000) { \ torture_result(tctx, TORTURE_FAIL, \ "(%s) wrong time for field %s %s - %s\n", \ __location__, #field, \