From d21a06bbb44a0044657de38c1eb544be8c335918 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 Nov 2002 00:10:04 +0000 Subject: Merge things that bloody tpot should be doing :-). Jeremy. (This used to be commit 77d534f7fd9ad74ca6d5e74860b29bb8ad54268f) --- source3/nsswitch/winbindd_util.c | 16 ++++++++++++++-- 1 file 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 */ -- cgit