summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-04 23:43:31 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-04 23:43:31 +0200
commitb65ba0e26c781647e097f3f6fa279c7f3f7f4bd2 (patch)
tree54dc54b593c809e160a7141e20b802bcc46662ed /source3/libsmb
parent7f097368ed3c65467add701f1b3eb99081769ddb (diff)
downloadsamba-b65ba0e26c781647e097f3f6fa279c7f3f7f4bd2.tar.gz
samba-b65ba0e26c781647e097f3f6fa279c7f3f7f4bd2.tar.bz2
samba-b65ba0e26c781647e097f3f6fa279c7f3f7f4bd2.zip
clikrb5: Prefer krb5_free_keytab_entry_contents to krb5_kt_free_entry.
Both functions exist in MIT Kerberos >= 1.7, but only krb5_free_keytab_entry_contents has a prototype.
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clikrb5.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index aa98d7668f..8a567dc751 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -924,10 +924,15 @@ failed:
krb5_error_code smb_krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *kt_entry)
{
-#if defined(HAVE_KRB5_KT_FREE_ENTRY)
- return krb5_kt_free_entry(context, kt_entry);
-#elif defined(HAVE_KRB5_FREE_KEYTAB_ENTRY_CONTENTS)
+/* Try krb5_free_keytab_entry_contents first, since
+ * MIT Kerberos >= 1.7 has both krb5_free_keytab_entry_contents and
+ * krb5_kt_free_entry but only has a prototype for the first, while the
+ * second is considered private.
+ */
+#if defined(HAVE_KRB5_FREE_KEYTAB_ENTRY_CONTENTS)
return krb5_free_keytab_entry_contents(context, kt_entry);
+#elif defined(HAVE_KRB5_KT_FREE_ENTRY)
+ return krb5_kt_free_entry(context, kt_entry);
#else
#error UNKNOWN_KT_FREE_FUNCTION
#endif