From 8ad224663576b32a4bcd43f808851d2cdde34656 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 20 Sep 2007 18:37:34 +0000 Subject: 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 used to be commit b8d67b78aa1c35e4e7e61050c1fccbb6d76d9fd7) --- source3/winbindd/winbindd_util.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 0175990f0c..0e6ba1c043 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -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; } -- cgit