From 7019103bab82b4e8fb80b38712ca24064b8d09a5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 15 Feb 2016 08:31:16 +0100 Subject: [PATCH] mit_samba: Return 0 in case of a wrong realm The MIT KDC will deal with this correctly for us. Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- source4/kdc/mit_samba.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/kdc/mit_samba.c b/source4/kdc/mit_samba.c index 57af4b71b1f..70877a9f0a4 100644 --- a/source4/kdc/mit_samba.c +++ b/source4/kdc/mit_samba.c @@ -220,7 +220,12 @@ int mit_samba_get_principal(struct mit_samba_context *ctx, ret = KRB5_KDB_NOENTRY; goto done; case SDB_ERR_WRONG_REALM: - ret = KRB5KDC_ERR_WRONG_REALM; + /* + * If we have a wrong realm e.g. if we try get a cross forest + * ticket, we return a ticket with the correct realm. The KDC + * will detect this an return the appropriate return code. + */ + ret = 0; break; case SDB_ERR_NOT_FOUND_HERE: /* FIXME: RODC support */ -- 2.34.1