]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth/credentials: use smb_krb5_cc_new_unique_memory() in smb_gss_krb5_copy_ccache()
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Feb 2024 15:19:58 +0000 (16:19 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 May 2024 11:30:33 +0000 (11:30 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
auth/credentials/credentials_krb5.c

index 61c69ee74db8f417c975e52e8123b3e8d0018f15..04a38aaeed5ae24432bea7c89dbb903aff977b76 100644 (file)
@@ -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;