From ecb21a0c71c9a3ea78c5879a0b698870ae69d1ff Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Mon, 21 Feb 2011 18:09:24 +0000 Subject: Use different flags for krb5_cc_retrieve_cred if not using MIT Kerberos. The fact that the Heimdal and MIT APIs are subtly different strikes again. I am honestly starting to wonder if they make it look this similar just to frustrate people; I only don't believe it because neither team seems like that sort of person. Fixes #74. --- lib/ZMkAuth.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c index a33574f..8ad1874 100644 --- a/lib/ZMkAuth.c +++ b/lib/ZMkAuth.c @@ -221,7 +221,15 @@ ZGetCredsRealm(krb5_creds **creds_out, result = krb5_cc_get_principal(Z_krb5_ctx, ccache, &creds_in.client); if (!result) { result = krb5_cc_retrieve_cred(Z_krb5_ctx, ccache, - KRB5_TC_SUPPORTED_KTYPES, &creds_in, &creds_tmp); +#if defined(KRB5_TC_SUPPORTED_KTYPES) + KRB5_TC_SUPPORTED_KTYPES, /* MIT */ +#elif defined(KRB5_TC_MATCH_SRV_NAMEONLY) + KRB5_TC_MATCH_SRV_NAMEONLY, /* Heimdal */ +#else + 0, /* Alien Space Kerberos where we just + try to do no harm */ +#endif + &creds_in, &creds_tmp); if (!result) { *creds_out = malloc(sizeof(creds_tmp)); if (*creds_out == NULL) -- cgit v1.2.3