if (!winbindd_param_init())
return False;
- /* Get list of domains we look up requests for. This includes the
- domain which we are a member of as well as any trusted
- domains. */
-
- init_domain_list();
-
/* Winbind daemon initialisation */
if (!winbindd_idmap_init())
have changed since we last looked. There may be a sequence
number or something we should use but I haven't found it yet. */
- init_domain_list();
+ if (!init_domain_list()) {
+ DEBUG(1, ("winbindd_list_trusted_domains: could not "
+ "refresh trusted domain list\n"));
+ return WINBINDD_ERROR;
+ }
for(domain = domain_list(); domain; domain = domain->next) {
/* Look up global info for the winbind daemon */
BOOL init_domain_list(void)
{
- NTSTATUS result;
extern struct winbindd_methods cache_methods;
struct winbindd_domain *domain;
/* Add ourselves as the first entry */
domain = add_trusted_domain(lp_workgroup(), NULL, &cache_methods, NULL);
-
- /*
- * Now we *must* get the domain sid for our primary domain. Go into
- * a holding pattern until that is available
- */
-
- result = cache_methods.domain_sid(domain, &domain->sid);
- while (!NT_STATUS_IS_OK(result)) {
-
- sleep(10);
- DEBUG(1,("Retrying startup domain sid fetch for %s\n",
- domain->name));
- result = cache_methods.domain_sid(domain, &domain->sid);
-
- /* If we don't call lp_talloc_free() here we end up
- accumulating memory in the "global" lp_talloc in
- param/loadparm.c */
-
- lp_talloc_free();
+ if (!secrets_fetch_domain_sid(domain->name, &domain->sid)) {
+ DEBUG(1, ("Could not fetch sid for our domain %s\n",
+ domain->name));
+ return False;
}
-
+
/* get any alternate name for the primary domain */
cache_methods.alternate_name(domain);