summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/providers/krb5/krb5_child.c8
-rw-r--r--src/providers/ldap/ldap_child.c3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index cc29c00f..f403dbc3 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -628,7 +628,8 @@ static krb5_error_code get_and_save_tgt_with_keytab(krb5_context ctx,
return kerr;
}
- kerr = create_ccache_file(ctx, princ, ccname, &creds);
+ /* Use the updated principal in the creds in case canonicalized */
+ kerr = create_ccache_file(ctx, creds.client, ccname, &creds);
if (kerr != 0) {
KRB5_DEBUG(1, kerr);
goto done;
@@ -685,7 +686,10 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr,
}
}
- kerr = create_ccache_file(kr->ctx, kr->princ, kr->ccname, kr->creds);
+ /* Use the updated principal in the creds in case canonicalized */
+ kerr = create_ccache_file(kr->ctx,
+ kr->creds ? kr->creds->client : kr->princ,
+ kr->ccname, kr->creds);
if (kerr != 0) {
KRB5_DEBUG(1, kerr);
goto done;
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 5356f883..e6bf4c3a 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -285,7 +285,8 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx,
goto done;
}
- krberr = krb5_cc_initialize(context, ccache, kprinc);
+ /* Use updated principal if changed due to canonicalization. */
+ krberr = krb5_cc_initialize(context, ccache, my_creds.client);
if (krberr) {
DEBUG(2, ("Failed to init ccache: %s\n",
sss_krb5_get_error_message(context, krberr)));