summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-15 13:44:44 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-17 13:17:26 +0200
commit4a25e68cd863318f18b2ca78cf6efa7a1921d33a (patch)
tree8a97a7b25fb742844685d10d145dd8fe866a7e34 /src/util
parent13734b9723e221cbb535306b89fc3e77fc2010de (diff)
downloadsssd-4a25e68cd863318f18b2ca78cf6efa7a1921d33a.tar.gz
sssd-4a25e68cd863318f18b2ca78cf6efa7a1921d33a.tar.bz2
sssd-4a25e68cd863318f18b2ca78cf6efa7a1921d33a.zip
heimdal: Add wrapper for krb5_get_time_offsets
Using krb5_get_kdc_sec_offset from heimdal.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sss_krb5.c22
-rw-r--r--src/util/sss_krb5.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index c9b16107..6382c1aa 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -1098,3 +1098,25 @@ sss_krb5_unparse_name_ext(krb5_context ctx,
return kerr;
}
+
+krb5_error_code KRB5_CALLCONV
+sss_krb5_get_time_offsets(krb5_context ctx,
+ krb5_timestamp *seconds,
+ int32_t *microseconds)
+{
+#if defined(HAVE_KRB5_GET_TIME_OFFSETS)
+ return krb5_get_time_offsets(ctx, seconds, microseconds);
+#elif defined(HAVE_KRB5_GET_KDC_SEC_OFFSET)
+ int32_t _seconds;
+ krb5_error_code ret;
+
+ ret = krb5_get_kdc_sec_offset(ctx, &_seconds, microseconds);
+ *seconds = _seconds;
+ return ret;
+#else
+ (void) ctx;
+ *seconds = 0;
+ *microseconds = 0;
+ return 0;
+#endif
+}
diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h
index c8f2d4d7..2ddcca97 100644
--- a/src/util/sss_krb5.h
+++ b/src/util/sss_krb5.h
@@ -192,4 +192,8 @@ sss_krb5_unparse_name_ext(krb5_context ctx,
krb5_const_principal principal,
char **name,
unsigned int *len);
+krb5_error_code KRB5_CALLCONV
+sss_krb5_get_time_offsets(krb5_context ctx,
+ krb5_timestamp *seconds,
+ int32_t *microseconds);
#endif /* __SSS_KRB5_H__ */