From 589456f4e8a630634d360a5369fe6c79c4fdec3a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Oct 2016 15:28:29 +0200 Subject: [PATCH] auth: Do not invalidate the cache on set_principal Signed-off-by: Andreas Schneider --- auth/credentials/credentials.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c index 39c25adbdb68..3571468ea274 100644 --- a/auth/credentials/credentials.c +++ b/auth/credentials/credentials.c @@ -263,6 +263,20 @@ _PUBLIC_ char *cli_credentials_get_principal(struct cli_credentials *cred, TALLO return cli_credentials_get_principal_and_obtained(cred, mem_ctx, &obtained); } +/** + * @brief Set a new principal to the credential cache. + * + * @note When setting a new principal, you should make sure to reinit the cache + * afterwards! + * + * @param[in] cred The credentials to set the principal on. + * + * @param[in] val The principal as a string to set. + * + * @param[in] obtained The way the principal has specified. + * + * @return true on success, false otherwise. + */ _PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred, const char *val, enum credentials_obtained obtained) @@ -274,7 +288,6 @@ _PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred, } cred->principal_obtained = obtained; - cli_credentials_invalidate_ccache(cred, cred->principal_obtained); return true; } -- 2.34.1