kauth: fix clock skew detection
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 22 Apr 2015 17:43:43 +0000 (13:43 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 6 May 2015 22:16:19 +0000 (18:16 -0400)
commit810f0ccd0354dac30af024ca7b5acf3ebabf5f4b
tree61394f52f03def308baa12116aed97e3091d7a9b
parentabca1fefc018e7f7ccc91ff31ada1d5e6d8076e0
kauth: fix clock skew detection

Commit 5b3c1042969daec38ccb260e61d665eda0c713ea changed/removed some
uses of abs() on unsigned time values. While the previous use of abs()
was indeed incorrect, the result wasn't necessarily much better, even
though it built with recent compilers, since it only checked for skew
in one direction.

Define and use a  macro to correctly evaluate the conditionals in 64-bit
precision, avoiding C's integer promotion rules which prefer unsigned types
(Date) to signed types of the same width (time_t on 32-bit systems).

Change-Id: Ifcbe59e73942a52a8635cb0f43cce94fdeea85a3
Reviewed-on: http://gerrit.openafs.org/11850
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/kauth/kaprocs.c
src/kauth/kauth_internal.h
src/kauth/krb_udp.c