Skip to content

Commit

Permalink
Fix KDC client referrals
Browse files Browse the repository at this point in the history
Although our built-in KDB modules do not support client referrals for
AS requests, the KDC is supposed to return one if a third-party module
returns a DB entry containing a principal in a foreign realm.
Unfortunately, this code has never worked; in prepare_error_as(), we
erroneously compare the protocol code errcode against the com_err code
KRB5KDC_ERR_WRONG_REALM; as a result, we never supply the canonical
client principal.  Fix this by comparing errcode against the protocol
code KDC_ERR_WRONG_REALM instead.

Discovered by Alexander Bokovoy and Simo Sorce.

(cherry picked from commit 4e036ef)

ticket: 8312 (new)
version_fixed: 1.12.5
status: resolved
  • Loading branch information
greghudson authored and tlyu committed Dec 9, 2015
1 parent 52d1cad commit 437fbad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kdc/do_as_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ prepare_error_as (struct kdc_request_state *rstate, krb5_kdc_req *request,
return retval;
errpkt.error = error;
errpkt.server = request->server;
errpkt.client = (error == KRB5KDC_ERR_WRONG_REALM) ? canon_client :
errpkt.client = (error == KDC_ERR_WRONG_REALM) ? canon_client :
request->client;
errpkt.text = string2data((char *)status);

Expand Down

0 comments on commit 437fbad

Please sign in to comment.