From f3f09aab44117d8eb97811421b2685c295d3d585 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 28 May 2018 15:06:46 -0700 Subject: Pass realm to krb5_appdefault_* functions When getting configuration values from krb5.conf, pass the default local realm into the Kerberos appdefault functions. This will produce more correct results with krb5.conf files that specify wallet configuration for multiple realms. --- portable/krb5.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'portable') diff --git a/portable/krb5.h b/portable/krb5.h index 63a2e9f..d8884a7 100644 --- a/portable/krb5.h +++ b/portable/krb5.h @@ -70,6 +70,15 @@ void krb5_appdefault_string(krb5_context, const char *, const krb5_data *, const char *, const char *, char **); #endif +/* + * MIT-specific. The Heimdal documentation says to use free(), but that + * doesn't actually make sense since the memory is allocated inside the + * Kerberos library. Use krb5_xfree instead. + */ +#ifndef HAVE_KRB5_FREE_DEFAULT_REALM +# define krb5_free_default_realm(c, r) krb5_xfree(r) +#endif + /* * krb5_{get,free}_error_message are the preferred APIs for both current MIT * and current Heimdal, but there are tons of older APIs we may have to fall -- cgit v1.2.3