summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-03-09 18:51:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:32 -0500
commit3adeb4274250ec4420d9d874b07d8e688a354402 (patch)
treed783eaa54a28fe825030142ce65b7b42da1d32e7 /source3/libsmb
parent257d2e0d2a6cd4c2ea62399ec97ada46dd8c395c (diff)
downloadsamba-3adeb4274250ec4420d9d874b07d8e688a354402.tar.gz
samba-3adeb4274250ec4420d9d874b07d8e688a354402.tar.bz2
samba-3adeb4274250ec4420d9d874b07d8e688a354402.zip
r21778: Wrap calls to krb5_get_init_creds_opt_free to handle the different
calling convention in the latest MIT changes. Apparantly Heimdal is also changing to this calling convention. (This used to be commit c29c69d2df377fabb88a78e6f5237de106d5c2c5)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clikrb5.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index f06a19b345..43dfddda47 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -1389,9 +1389,14 @@ done:
return ret;
}
-#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC
- krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opt)
+ krb5_error_code smb_krb5_get_init_creds_opt_alloc(krb5_context context,
+ krb5_get_init_creds_opt **opt)
{
+#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC
+ /* Heimdal or modern MIT version */
+ return krb5_get_init_creds_opt_alloc(context, opt);
+#else
+ /* Historical MIT version */
krb5_get_init_creds_opt *my_opt;
*opt = NULL;
@@ -1404,16 +1409,28 @@ done:
*opt = my_opt;
return 0;
+#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC */
}
-#endif
-#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE
- void krb5_get_init_creds_opt_free(krb5_get_init_creds_opt *opt)
+ void smb_krb5_get_init_creds_opt_free(krb5_context context,
+ krb5_get_init_creds_opt *opt)
{
+#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE
+
+#ifdef KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT
+ /* Modern MIT version */
+ krb5_get_init_creds_opt_free(context, opt);
+#else
+ /* Heimdal version */
+ krb5_get_init_creds_opt_free(opt);
+#endif
+
+#else /* HAVE_KRB5_GET_INIT_CREDS_OPT_FREE */
+ /* Historical MIT version */
SAFE_FREE(opt);
opt = NULL;
+#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_FREE */
}
-#endif
#else /* HAVE_KRB5 */
/* this saves a few linking headaches */