From 1898eaddb805e86d0c36bd289e7fa61d7bbd4810 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 1 Feb 2007 15:10:13 +0000 Subject: r21110: Fix kinit with Heimdal (Bug #4226). Guenther (This used to be commit ea38e1f8362d75e7ac058a7c4aa06f1ca92ec108) --- source3/libsmb/clikrb5.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/libsmb/clikrb5.c') diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c index 4092b4b2b9..305139e1f4 100644 --- a/source3/libsmb/clikrb5.c +++ b/source3/libsmb/clikrb5.c @@ -1379,6 +1379,32 @@ 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_get_init_creds_opt *my_opt; + + *opt = NULL; + + if ((my_opt = SMB_MALLOC(sizeof(krb5_get_init_creds_opt))) == NULL) { + return ENOMEM; + } + + krb5_get_init_creds_opt_init(my_opt); + + *opt = my_opt; + return 0; +} +#endif + +#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE + void krb5_get_init_creds_opt_free(krb5_get_init_creds_opt *opt) +{ + SAFE_FREE(opt); + opt = NULL; +} +#endif + #else /* HAVE_KRB5 */ /* this saves a few linking headaches */ int cli_krb5_get_ticket(const char *principal, time_t time_offset, -- cgit