unsigned int num_comp;
bool ok;
char *upper = NULL;
+ bool get_krbtgt = false;
num_comp = krb5_princ_size(context, principal);
ret = principal_comp_strcmp(context, principal, 0, KRB5_TGS_NAME);
if (ret == 0) {
- /*
- * we need to search krbtgt/ locally
- */
- TALLOC_FREE(frame);
- return 0;
+ if (num_comp != 2) {
+ TALLOC_FREE(frame);
+ return SDB_ERR_NOENTRY;
+ }
+ get_krbtgt = true;
}
/*
return 0;
}
+ if (get_krbtgt) {
+ ok = strequal(realm, tdo->domain_name.string);
+ if (ok) {
+ /*
+ * This principal has to be local
+ */
+ TALLOC_FREE(frame);
+ return 0;
+ }
+ ok = strequal(realm, tdo->netbios_name.string);
+ if (ok) {
+ /*
+ * This principal has to be local
+ */
+ TALLOC_FREE(frame);
+ return 0;
+ }
+ }
+
if (tdo->trust_attributes & LSA_TRUST_ATTRIBUTE_WITHIN_FOREST) {
/*
* TODO: handle the routing within the forest