mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
credentials: Only do shallow copies of valid ccaches
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
8bde5ea169
commit
f43ac073b2
@ -896,12 +896,26 @@ static int cli_credentials_shallow_ccache(struct cli_credentials *cred)
|
|||||||
const struct ccache_container *old_ccc = NULL;
|
const struct ccache_container *old_ccc = NULL;
|
||||||
struct ccache_container *ccc = NULL;
|
struct ccache_container *ccc = NULL;
|
||||||
char *ccache_name = NULL;
|
char *ccache_name = NULL;
|
||||||
|
krb5_principal princ;
|
||||||
|
|
||||||
old_ccc = cred->ccache;
|
old_ccc = cred->ccache;
|
||||||
if (old_ccc == NULL) {
|
if (old_ccc == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = krb5_cc_get_principal(
|
||||||
|
old_ccc->smb_krb5_context->krb5_context,
|
||||||
|
old_ccc->ccache,
|
||||||
|
&princ);
|
||||||
|
if (ret != 0) {
|
||||||
|
/*
|
||||||
|
* This is an empty ccache. No point in copying anything.
|
||||||
|
*/
|
||||||
|
cred->ccache = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
krb5_free_principal(old_ccc->smb_krb5_context->krb5_context, princ);
|
||||||
|
|
||||||
ccc = talloc(cred, struct ccache_container);
|
ccc = talloc(cred, struct ccache_container);
|
||||||
if (ccc == NULL) {
|
if (ccc == NULL) {
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user