mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r1193: Ensure we check for and use krb5_free_unparsed_name().
Jeremy.
(This used to be commit af5a08f5ad
)
This commit is contained in:
parent
d703c350cb
commit
f38c27b4e0
@ -2736,6 +2736,7 @@ if test x"$with_ads_support" != x"no"; then
|
||||
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"
|
||||
|
||||
|
@ -1294,6 +1294,10 @@ krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype
|
||||
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);
|
||||
|
@ -154,7 +154,8 @@ int ads_keytab_add_entry(const char *srvPrinc, ADS_STRUCT *ads)
|
||||
#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",
|
||||
@ -479,7 +480,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
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. */
|
||||
@ -512,7 +513,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user