uint32_t domain_flags; /* Domain flags from netlogon.h */
uint32_t domain_type; /* Domain type from netlogon.h */
uint32_t domain_trust_attribs; /* Trust attribs from netlogon.h */
+ const struct winbindd_domain *routing_domain;
bool initialized; /* Did we already ask for the domain mode? */
bool native_mode; /* is this a win2k domain in native mode ? */
bool active_directory; /* is this a win2k active directory ? */
struct winbindd_domain *domain_list(void);
struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
+bool set_routing_domain(struct winbindd_domain *domain,
+ const struct winbindd_domain *routing_domain);
bool domain_is_forest_root(const struct winbindd_domain *domain);
void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
struct timeval now, void *private_data);
return NT_STATUS_OK;
}
+bool set_routing_domain(struct winbindd_domain *domain,
+ const struct winbindd_domain *routing_domain)
+{
+ if (domain->routing_domain == NULL) {
+ domain->routing_domain = routing_domain;
+ return true;
+ }
+ if (domain->routing_domain != routing_domain) {
+ return false;
+ }
+ return true;
+}
+
bool domain_is_forest_root(const struct winbindd_domain *domain)
{
const uint32_t fr_flags =
struct ForestTrustInfo fti;
uint32_t fi;
enum ndr_err_code ndr_err;
+ struct winbindd_domain *routing_domain = NULL;
+ bool ok;
if (domains[i]->trust_type != LSA_TRUST_TYPE_UPLEVEL) {
continue;
continue;
}
+ routing_domain = find_domain_from_name_noinit(
+ domains[i]->netbios_name);
+ if (routing_domain == NULL) {
+ DBG_ERR("Can't find winbindd domain [%s]\n",
+ domains[i]->netbios_name);
+ return false;
+ }
+
ndr_err = ndr_pull_struct_blob_all(
&domains[i]->trust_forest_trust_info,
talloc_tos(), &fti,
nt_errstr(status));
return false;
}
+ if (domain == NULL) {
+ continue;
+ }
+ ok = set_routing_domain(domain, routing_domain);
+ if (!ok) {
+ DBG_ERR("set_routing_domain on [%s] to "
+ "[%s] failed\n",
+ domain->name,
+ routing_domain->name);
+ return false;
+ }
}
}
} else if (IS_DC) {