From b2317c097954844af4a0596fea507f0139d14465 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 2 Jan 2007 21:48:47 +0000 Subject: r20488: When joined to a child domain in a multi-domain/single domain tree, the child domain cannot always resolve SIDs in sibling domains. Windows tries to contact a DC in its own domain and then the root domain in the forest. This async changes makes winbindd's name2sid() call do the same. (This used to be commit 7b2bf0e5a6b8d4119657c7a34aa53c9a0c1d5723) --- source3/nsswitch/winbindd_util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/nsswitch/winbindd_util.c') diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index d0a59b0cbe..419c80e3c4 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -529,6 +529,10 @@ BOOL init_domain_list(void) &cache_methods, &our_sid); domain->primary = True; setup_domain_child(domain, &domain->child, NULL); +#if 0 /* old code needed to get the parent domain */ + init_dc_connection(domain); +#endif + /* Even in the parent winbindd we'll need to talk to the DC, so try and see if we can contact it. Theoretically this isn't neccessary @@ -652,6 +656,19 @@ struct winbindd_domain *find_our_domain(void) return NULL; } +struct winbindd_domain *find_root_domain(void) +{ + struct winbindd_domain *ours = find_our_domain(); + + if ( !ours ) + return NULL; + + if ( strlen(ours->forest_name) == 0 ) + return NULL; + + return find_domain_from_name( ours->forest_name ); +} + struct winbindd_domain *find_builtin_domain(void) { DOM_SID sid; -- cgit