summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-15 12:42:35 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-10-17 13:17:26 +0200
commit0740b9ab9acc2ecae9342d2db42c4645ae4104eb (patch)
tree055790cfeaed6aedc73465f557c6e09cd9f83328
parentfb26a7edaf0fcee44fd60eabf4aaf38f0680c0ff (diff)
downloadsssd-0740b9ab9acc2ecae9342d2db42c4645ae4104eb.tar.gz
sssd-0740b9ab9acc2ecae9342d2db42c4645ae4104eb.tar.bz2
sssd-0740b9ab9acc2ecae9342d2db42c4645ae4104eb.zip
heimdal: Add wrapper for krb5_free_string
Uses krb5_free_string for MIT and krb5_xfree for heimdal.
-rw-r--r--src/external/krb5.m44
-rw-r--r--src/util/sss_krb5.c11
-rw-r--r--src/util/sss_krb5.h2
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);