mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
auth/credentials: use smb_krb5_cc_new_unique_memory() in cli_credentials_shallow_ccache()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
5d385ab691
commit
176c55efb2
@ -1138,7 +1138,6 @@ static int cli_credentials_shallow_ccache(struct cli_credentials *cred)
|
||||
const struct ccache_container *old_ccc = NULL;
|
||||
enum credentials_obtained old_obtained;
|
||||
struct ccache_container *ccc = NULL;
|
||||
char *ccache_name = NULL;
|
||||
krb5_principal princ;
|
||||
|
||||
old_obtained = cred->ccache_obtained;
|
||||
@ -1171,10 +1170,10 @@ static int cli_credentials_shallow_ccache(struct cli_credentials *cred)
|
||||
*ccc = *old_ccc;
|
||||
ccc->ccache = NULL;
|
||||
|
||||
ccache_name = talloc_asprintf(ccc, "MEMORY:%p", ccc);
|
||||
|
||||
ret = krb5_cc_resolve(ccc->smb_krb5_context->krb5_context,
|
||||
ccache_name, &ccc->ccache);
|
||||
ret = smb_krb5_cc_new_unique_memory(ccc->smb_krb5_context->krb5_context,
|
||||
NULL,
|
||||
NULL,
|
||||
&ccc->ccache);
|
||||
if (ret != 0) {
|
||||
TALLOC_FREE(ccc);
|
||||
return ret;
|
||||
@ -1182,8 +1181,6 @@ static int cli_credentials_shallow_ccache(struct cli_credentials *cred)
|
||||
|
||||
talloc_set_destructor(ccc, free_mccache);
|
||||
|
||||
TALLOC_FREE(ccache_name);
|
||||
|
||||
ret = smb_krb5_cc_copy_creds(ccc->smb_krb5_context->krb5_context,
|
||||
old_ccc->ccache, ccc->ccache);
|
||||
if (ret != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user