From: Stefan Metzmacher Date: Tue, 27 Feb 2024 15:19:58 +0000 (+0100) Subject: auth/credentials: use smb_krb5_cc_new_unique_memory() in smb_gss_krb5_copy_ccache() X-Git-Tag: tdb-1.4.11~841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d385ab691f21bdd4524c41560c7f53653cf179d;p=thirdparty%2Fsamba.git auth/credentials: use smb_krb5_cc_new_unique_memory() in smb_gss_krb5_copy_ccache() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index 61c69ee74db..04a38aaeed5 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -79,25 +79,15 @@ static uint32_t smb_gss_krb5_copy_ccache(uint32_t *min_stat, krb5_cc_cursor cursor = NULL; krb5_principal princ = NULL; krb5_error_code code; - char *dummy_name; uint32_t maj_stat = GSS_S_FAILURE; - dummy_name = talloc_asprintf(ccc, - "MEMORY:gss_krb5_copy_ccache-%p", - &ccc->ccache); - if (dummy_name == NULL) { - *min_stat = ENOMEM; - return GSS_S_FAILURE; - } - /* * Create a dummy ccache, so we can iterate over the credentials * and find the default principal for the ccache we want to * copy. The new ccache needs to be initialized with this * principal. */ - code = krb5_cc_resolve(context, dummy_name, &dummy_ccache); - TALLOC_FREE(dummy_name); + code = smb_krb5_cc_new_unique_memory(context, NULL, NULL, &dummy_ccache); if (code != 0) { *min_stat = code; return GSS_S_FAILURE;