AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_free_data_contents, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_principal_get_comp_string, $KRB5_LIBS)
+ AC_CHECK_FUNC_EXT(krb5_free_unparsed_name, $KRB5_LIBS)
LIBS="$LIBS $KRB5_LIBS"
krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock *keyblock);
#endif
+#ifndef (HAVE_KRB5_FREE_UNPARSED_NAME)
+void krb5_free_unparsed_name(krb5_context ctx, char *val)
+#endif
+
/* Samba wrapper function for krb5 functionality. */
void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr);
int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
#else
compare_ok = ((strcmp(ktprinc, princ_s) == 0) && (kt_entry.vno != kvno - 1));
#endif
- SAFE_FREE(ktprinc);
+ krb5_free_unparsed_name(ktprinc);
+ ktprinc = NULL;
if (compare_ok) {
DEBUG(3,("ads_keytab_add_entry: Found old entry for principal: %s (kvno %d) - trying to remove it.\n",
if (ret != KRB5_KT_END && ret != ENOENT ) {
while ((ret = krb5_kt_next_entry(context, keytab, &kt_entry, &cursor)) == 0) {
if (kt_entry.vno != kvno) {
- char *ktprinc;
+ char *ktprinc = NULL;
char *p;
/* This returns a malloc'ed string in ktprinc. */
}
for (i = 0; oldEntries[i]; i++) {
ret |= ads_keytab_add_entry(oldEntries[i], ads);
- SAFE_FREE(oldEntries[i]);
+ krb5_free_unparsed_name(oldEntries[i]);
}
krb5_kt_end_seq_get(context, keytab, &cursor);
}