From b9b39d222667df44c6311ae8c5857218338642ac Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 1 Sep 1995 05:45:06 +0000 Subject: [PATCH] Add time offset field to the os_context structure. This offset is added to the system clock time to produce the "true" time. Added prototypes for the functions which manipulate the time offset structures: krb5_set_real_time(), krb5_set_debugging_time(), krb5_use_natural_time(), krb5_get_time_offsets(), and krb5_set_time_offsets(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6648 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 10 ++++++++++ src/include/k5-int.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index c6c19e417..42c0913da 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,13 @@ +Fri Sep 1 00:44:59 1995 Theodore Y. Ts'o + + * k5-int.h: Add time offset field to the os_context structure. + This offset is added to the system clock time to produce + the "true" time. + + Added prototypes for the functions which manipulate the + time offset structures: krb5_set_real_time(), + krb5_set_debugging_time(), krb5_use_natural_time(), + krb5_get_time_offsets(), and krb5_set_time_offsets(). Tue Aug 29 13:26:22 EDT 1995 Paul Park (pjpark@mit.edu) * k5-int.h - Add ser_ctx[_count] to krb5_context. This keeps track diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 9240a50ea..d4031dd12 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -722,6 +722,17 @@ krb5_error_code krb5_make_fulladdr krb5_address *, krb5_address *)); +krb5_error_code krb5_set_real_time + KRB5_PROTOTYPE((krb5_context, krb5_int32, krb5_int32)); +krb5_error_code krb5_set_debugging_time + KRB5_PROTOTYPE((krb5_context, krb5_int32, krb5_int32)); +krb5_error_code krb5_use_natural_time + KRB5_PROTOTYPE((krb5_context)); +krb5_error_code krb5_get_time_offsets + KRB5_PROTOTYPE((krb5_context, krb5_int32 *, krb5_int32 *)); +krb5_error_code krb5_set_time_offsets + KRB5_PROTOTYPE((krb5_context, krb5_int32, krb5_int32)); + /* in here to deal with stuff from lib/crypto/os */ krb5_error_code krb5_crypto_os_localaddr @@ -752,8 +763,28 @@ time_t gmt_mktime KRB5_PROTOTYPE((struct tm *)); typedef struct _krb5_os_context { krb5_magic magic; + krb5_int32 time_offset; + krb5_int32 usec_offset; + krb5_int32 os_flags; } *krb5_os_context; +/* + * Flags for the os_flags field + * + * KRB5_OS_TOFFSET_VALID means that the time offset fields are valid. + * The intention is that this facility to correct the system clocks so + * that they reflect the "real" time, for systems where for some + * reason we can't set the system clock. Instead we calculate the + * offset between the system time and real time, and store the offset + * in the os context so that we can correct the system clock as necessary. + * + * KRB5_OS_TOFFSET_TIME means that the time offset fields should be + * returned as the time by the krb5 time routines. This should only + * be used for testing purposes (obviously!) + */ +#define KRB5_OS_TOFFSET_VALID 1 +#define KRB5_OS_TOFFSET_TIME 2 + /* lock mode flags */ #define KRB5_LOCKMODE_SHARED 0x0001 #define KRB5_LOCKMODE_EXCLUSIVE 0x0002 -- 2.26.2