diff options
-rw-r--r-- | src/external/krb5.m4 | 4 | ||||
-rw-r--r-- | src/util/sss_krb5.c | 11 | ||||
-rw-r--r-- | src/util/sss_krb5.h | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/external/krb5.m4 b/src/external/krb5.m4 index b9d6ff20..ba92da2a 100644 --- a/src/external/krb5.m4 +++ b/src/external/krb5.m4 @@ -64,7 +64,9 @@ AC_CHECK_FUNCS([krb5_get_init_creds_opt_alloc krb5_get_error_message \ krb5_timestamp_to_sfstring \ krb5_set_trace_callback \ krb5_find_authdata \ - krb5_cc_get_full_name]) + krb5_cc_get_full_name \ + krb5_free_string \ + krb5_xfree]) CFLAGS=$SAVE_CFLAGS LIBS=$SAVE_LIBS diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c index f8a7e6f9..5f36f7e9 100644 --- a/src/util/sss_krb5.c +++ b/src/util/sss_krb5.c @@ -545,6 +545,15 @@ void KRB5_CALLCONV sss_krb5_free_unparsed_name(krb5_context context, char *name) #endif } +void KRB5_CALLCONV sss_krb5_free_string(krb5_context ctx, char *val) +{ +/* TODO: ensure at least on is available in krb5.m4 */ +#ifdef HAVE_KRB5_FREE_STRING + krb5_free_string(ctx, val); +#elif HAVE_KRB5_XFREE + (void) krb5_xfree(val); +#endif +} krb5_error_code KRB5_CALLCONV sss_krb5_get_init_creds_opt_set_expire_callback( krb5_context context, @@ -1063,7 +1072,7 @@ done: KRB5_DEBUG(SSSDBG_MINOR_FAILURE, ctx, kerr); } } - krb5_free_string(ctx, tmp_ccname); + sss_krb5_free_string(ctx, tmp_ccname); return ret_ccname; #else diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h index db47e0a6..43243735 100644 --- a/src/util/sss_krb5.h +++ b/src/util/sss_krb5.h @@ -70,6 +70,8 @@ void KRB5_CALLCONV sss_krb5_get_init_creds_opt_free (krb5_context context, void KRB5_CALLCONV sss_krb5_free_unparsed_name(krb5_context context, char *name); +void KRB5_CALLCONV sss_krb5_free_string(krb5_context ctx, char *val); + int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name, krb5_context context, krb5_keytab keytab); |