From 246a24f393ffd3c9dfcce56618804ad59edc996e Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 2 Jun 2012 14:06:58 -0400 Subject: Add krb5_kt_have_content API Add the krb5_kt_have_content API from Heimdal, which can be used to test whether a keytab exists and contains entries. Add tests to t_keytab.c. There is a deviation from Heimdal in the function signature. Heimdal's signature returns a krb5_boolean at the moment, because the Heimdal implementation actually returns a krb5_error_code. These are generally the same type anyway (int). ticket: 7158 (new) --- src/include/krb5/krb5.hin | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include') diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index 3208be54c..ca5ccbd0e 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -2872,6 +2872,18 @@ krb5_error_code KRB5_CALLCONV krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor); +/** + * Check if a keytab exists and contains entries. + * + * @param [in] context Library context + * @param [in] keytab Key table handle + * + * @retval 0 Keytab exists and contains entries + * @retval KRB5_KT_NOTFOUND Keytab does not contain entries + */ +krb5_error_code KRB5_CALLCONV +krb5_kt_have_content(krb5_context context, krb5_keytab keytab); + /* * end "keytab.h" */ -- cgit