s4:kdc: Consider a singleā€component krbtgt principal to be the TGS
[samba.git] / source4 / kdc / db-glue.c
index 29b60a663c76392299bf8e2686253c4578152d83..af69ee86aac62e80538ae61ddb27c79e80f91edd 100644 (file)
@@ -2488,7 +2488,7 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context,
        }
 
        if (lpcfg_is_my_domain_or_realm(lp_ctx, realm_from_princ)
-           && lpcfg_is_my_domain_or_realm(lp_ctx, realm_princ_comp)) {
+           && (realm_princ_comp == NULL || lpcfg_is_my_domain_or_realm(lp_ctx, realm_princ_comp))) {
                /* us, or someone quite like us */
                /* Kludge, kludge, kludge.  If the realm part of krbtgt/realm,
                 * is in our db, then direct the caller at our primary