1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

r25260: add trusted domains always to the end of the list.

Now BUILTIN is always the first domain followed
by the domain of our own SAM DB and the primary
domain (in member server mode).

metze
This commit is contained in:
Stefan Metzmacher 2007-09-20 18:37:34 +00:00 committed by Gerald (Jerry) Carter
parent 8b5c34b7d1
commit b8d67b78aa

View File

@ -186,7 +186,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
}
/* Link to domain list */
DLIST_ADD(_domain_list, domain);
DLIST_ADD_END(_domain_list, domain, struct winbindd_domain *);
wcache_tdc_add_domain( domain );
@ -688,6 +688,25 @@ BOOL init_domain_list(void)
/* Free existing list */
free_domain_list();
/* BUILTIN domain */
domain = add_trusted_domain("BUILTIN", NULL, &passdb_methods,
&global_sid_Builtin);
if (domain) {
setup_domain_child(domain, &domain->child, NULL);
}
/* Local SAM */
domain = add_trusted_domain(get_global_sam_name(), NULL,
&passdb_methods, get_global_sam_sid());
if (domain) {
if ( role != ROLE_DOMAIN_MEMBER ) {
domain->primary = True;
}
setup_domain_child(domain, &domain->child, NULL);
}
/* Add ourselves as the first entry. */
if ( role == ROLE_DOMAIN_MEMBER ) {
@ -714,25 +733,6 @@ BOOL init_domain_list(void)
}
}
/* Local SAM */
domain = add_trusted_domain(get_global_sam_name(), NULL,
&passdb_methods, get_global_sam_sid());
if (domain) {
if ( role != ROLE_DOMAIN_MEMBER ) {
domain->primary = True;
}
setup_domain_child(domain, &domain->child, NULL);
}
/* BUILTIN domain */
domain = add_trusted_domain("BUILTIN", NULL, &passdb_methods,
&global_sid_Builtin);
if (domain) {
setup_domain_child(domain, &domain->child, NULL);
}
return True;
}