From d86ec3abce71706e8ee535c7b83ea3da6d82e328 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 4 Apr 2025 13:32:41 +0200 Subject: [PATCH] auth:creds: Always store the ccache name This will allow us to specify the cache as one to fill with credentials. Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- auth/credentials/credentials_internal.h | 1 + auth/credentials/credentials_krb5.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/auth/credentials/credentials_internal.h b/auth/credentials/credentials_internal.h index cda361e1dd0..72ec390ad7e 100644 --- a/auth/credentials/credentials_internal.h +++ b/auth/credentials/credentials_internal.h @@ -74,6 +74,7 @@ struct cli_credentials { DATA_BLOB nt_response; DATA_BLOB nt_session_key; + const char *ccache_name; struct ccache_container *ccache; struct gssapi_creds_container *client_gss_creds; struct keytab_container *keytab; diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index f905fe736cc..e5d16bebd3a 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -293,6 +293,14 @@ _PUBLIC_ int cli_credentials_set_ccache(struct cli_credentials *cred, return 0; } + if (name != NULL) { + cred->ccache_name = talloc_strdup(cred, name); + if (cred->ccache_name == NULL) { + (*error_string) = error_message(ENOMEM); + return ENOMEM; + } + } + ccc = talloc(cred, struct ccache_container); if (!ccc) { (*error_string) = error_message(ENOMEM); -- 2.47.2