]> git.michaelhowe.org Git - packages/o/openafs.git/commit
kauth: fix clock skew detection
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 22 Apr 2015 17:43:43 +0000 (13:43 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 28 May 2015 12:49:25 +0000 (08:49 -0400)
commit264ac76af4e82b0a1e1b27f3f4482100fb1bde20
tree18538e654dfd6c8cc98f04a450056f6443adf3b3
parent3bd4e8f797ce9834ff128468b777d870a9ee3dae
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).

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>
(cherry picked from commit 810f0ccd0354dac30af024ca7b5acf3ebabf5f4b)

Change-Id: I29337e1ecd410fcf7733408287930c50c055ff90
Reviewed-on: http://gerrit.openafs.org/11863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/kauth/kaprocs.c
src/kauth/kauth_internal.h
src/kauth/krb_udp.c