summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2011-02-21 18:09:24 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2011-02-21 18:09:24 +0000
commitecb21a0c71c9a3ea78c5879a0b698870ae69d1ff (patch)
treeb15297c243d0b66db1b9e4a6e5ee27be00e993e3 /lib
parent71928f99ec3b0f5984d83438da266c7ef97afb5a (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/ZMkAuth.c10
1 files changed, 9 insertions, 1 deletions
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)