diff options
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index cb8870d6f3..e3f00149f7 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -153,12 +153,17 @@ void rescan_trusted_domains(void) static time_t last_scan; time_t t = time(NULL); + /* trusted domains might be disabled */ + if (!lp_allow_trusted_domains()) { + return; + } + /* ony rescan every few minutes */ if ((unsigned)(t - last_scan) < WINBINDD_RESCAN_FREQ) { return; } - last_scan = time(NULL); - + last_scan = t; + DEBUG(1, ("scanning trusted domain list\n")); if (!(mem_ctx = talloc_init_named("init_domain_list"))) @@ -209,10 +214,17 @@ BOOL init_domain_list(void) 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(); } /* get any alternate name for the primary domain */ |