diff options
author | Jeremy Allison <jra@samba.org> | 2004-06-19 00:54:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:59 -0500 |
commit | f38c27b4e092f5846bf1b547405df68e4bf3391d (patch) | |
tree | 9abbacfb4e5a3ea8ac72f7e01947a2235c43003a | |
parent | d703c350cbbd04d7cea79575dc1bfec284cb1cb5 (diff) | |
download | samba-f38c27b4e092f5846bf1b547405df68e4bf3391d.tar.gz samba-f38c27b4e092f5846bf1b547405df68e4bf3391d.tar.bz2 samba-f38c27b4e092f5846bf1b547405df68e4bf3391d.zip |
r1193: Ensure we check for and use krb5_free_unparsed_name().
Jeremy.
(This used to be commit af5a08f5ad895cb33c9134771da19ba5e709e742)
-rw-r--r-- | source3/configure.in | 1 | ||||
-rw-r--r-- | source3/include/includes.h | 4 | ||||
-rw-r--r-- | source3/libads/kerberos_keytab.c | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/source3/configure.in b/source3/configure.in index 6975c62b39..b77016c0e3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -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" diff --git a/source3/include/includes.h b/source3/include/includes.h index 9efdd2cc3a..ea22475da2 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -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); diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c index 95ff0c1cf3..605c7e1b1a 100644 --- a/source3/libads/kerberos_keytab.c +++ b/source3/libads/kerberos_keytab.c @@ -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); } |