Blame SOURCES/Add-y2038-documentation.patch

963210
From f9702eabc568679f48ea5d0bc7be073582cc52ad Mon Sep 17 00:00:00 2001
963210
From: Greg Hudson <ghudson@mit.edu>
963210
Date: Thu, 4 May 2017 17:03:35 -0400
963210
Subject: [PATCH] Add y2038 documentation
963210
963210
ticket: 8352
963210
(cherry picked from commit 85d64c43dbf7a7faa56a1999494cdfa49e8bd2c9)
963210
---
963210
 doc/appdev/index.rst |  1 +
963210
 doc/appdev/y2038.rst | 28 ++++++++++++++++++++++++++++
963210
 2 files changed, 29 insertions(+)
963210
 create mode 100644 doc/appdev/y2038.rst
963210
963210
diff --git a/doc/appdev/index.rst b/doc/appdev/index.rst
963210
index 3d62045ca..961bb1e9e 100644
963210
--- a/doc/appdev/index.rst
963210
+++ b/doc/appdev/index.rst
963210
@@ -5,6 +5,7 @@ For application developers
963210
    :maxdepth: 1
963210
 
963210
    gssapi.rst
963210
+   y2038.rst
963210
    h5l_mit_apidiff.rst
963210
    init_creds.rst
963210
    princ_handle.rst
963210
diff --git a/doc/appdev/y2038.rst b/doc/appdev/y2038.rst
963210
new file mode 100644
963210
index 000000000..bc4122dad
963210
--- /dev/null
963210
+++ b/doc/appdev/y2038.rst
963210
@@ -0,0 +1,28 @@
963210
+Year 2038 considerations for uses of krb5_timestamp
963210
+===================================================
963210
+
963210
+POSIX time values, which measure the number of seconds since January 1
963210
+1970, will exceed the maximum value representable in a signed 32-bit
963210
+integer in January 2038.  This documentation describes considerations
963210
+for consumers of the MIT krb5 libraries.
963210
+
963210
+Applications or libraries which use libkrb5 and consume the timestamps
963210
+included in credentials or other structures make use of the
963210
+:c:type:`krb5_timestamp` type.  For historical reasons, krb5_timestamp
963210
+is a signed 32-bit integer, even on platforms where a larger type is
963210
+natively used to represent time values.  To behave properly for time
963210
+values after January 2038, calling code should cast krb5_timestamp
963210
+values to uint32_t, and then to time_t::
963210
+
963210
+    (time_t)(uint32_t)timestamp
963210
+
963210
+Used in this way, krb5_timestamp values can represent time values up
963210
+until February 2106, provided that the platform uses a 64-bit or
963210
+larger time_t type.  This usage will also remain safe if a later
963210
+version of MIT krb5 changes krb5_timestamp to an unsigned 32-bit
963210
+integer.
963210
+
963210
+The GSSAPI only uses representations of time intervals, not absolute
963210
+times.  Callers of the GSSAPI should require no changes to behave
963210
+correctly after January 2038, provided that they use MIT krb5 release
963210
+1.16 or later.