auth: Do not invalidate the cache on set_principal
authorAndreas Schneider <asn@samba.org>
Thu, 6 Oct 2016 13:28:29 +0000 (15:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 12:39:20 +0000 (13:39 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
auth/credentials/credentials.c

index 39c25adbdb6836e3e247ed62757f0caadbb9e899..3571468ea2743fad2f1793080c6a4f8c4c06f298 100644 (file)
@@ -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;
        }