]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix KDC client referrals
authorGreg Hudson <ghudson@mit.edu>
Thu, 3 Sep 2015 16:38:44 +0000 (12:38 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 14 Sep 2015 23:38:38 +0000 (19:38 -0400)
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.

ticket: 8241 (new)
target_version: 1.13.3
tags: pullup

src/kdc/do_as_req.c

index 3a3ce8b47d481d7cb175c3b48a42a9cebeaceb26..544094933245838be7d818c6e83240e46a47d27a 100644 (file)
@@ -862,7 +862,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);