auth: Call cli_credentials_ccache_reinit() in set_principal
authorAndreas Schneider <asn@samba.org>
Thu, 6 Oct 2016 06:18:16 +0000 (08:18 +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..de45220de8ed42211749c51f0c92587e772f4c7f 100644 (file)
@@ -268,6 +268,9 @@ _PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred,
                                   enum credentials_obtained obtained)
 {
        if (obtained >= cred->principal_obtained) {
+               struct loadparm_context *lp_ctx;
+               bool ok;
+
                cred->principal = talloc_strdup(cred, val);
                if (cred->principal == NULL) {
                        return false;
@@ -275,7 +278,15 @@ _PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred,
                cred->principal_obtained = obtained;
 
                cli_credentials_invalidate_ccache(cred, cred->principal_obtained);
-               return true;
+
+               lp_ctx = loadparm_init_s3(cred, loadparm_s3_helpers());
+               if (lp_ctx == NULL) {
+                       return false;
+               }
+               ok = cli_credentials_ccache_reinit(cred, lp_ctx);
+               talloc_free(lp_ctx);
+
+               return ok;
        }
 
        return false;