[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch to add support for krb5_set_real_time()
The attached patch adds support for krb5_set_real_time(); adjust
krb5-protos.h appropriately.
-- Luke
Index: time.c
===================================================================
RCS file: /home/project/cvs/heimdal/lib/krb5/time.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- time.c 2002/08/11 23:54:24 1.1.1.1
+++ time.c 2002/11/04 12:00:01 1.3
@@ -33,12 +33,27 @@
#include "krb5_locl.h"
-RCSID("$Id: time.c,v 1.1.1.1 2002/08/11 23:54:24 lukeh Exp $");
+RCSID("$Id: time.c,v 1.3 2002/11/04 12:00:01 lukeh Exp $");
+krb5_error_code
+krb5_set_real_time (krb5_context context,
+ int32_t seconds,
+ int32_t microseconds)
+{
+ krb5_error_code ret;
+ int32_t sec, usec;
+
+ ret= krb5_us_timeofday(context, &sec, &usec);
+ if (ret)
+ return ret;
+ context->kdc_sec_offset = seconds - sec;
+ context->kdc_usec_offset = microseconds - usec;
+ return 0;
+}
+
/*
* return ``corrected'' time in `timeret'.
*/
-
krb5_error_code
krb5_timeofday (krb5_context context,
krb5_timestamp *timeret)
--
Luke Howard | PADL Software Pty Ltd | www.padl.com