summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-02-14 00:31:30 +0000
committerTim Potter <tpot@samba.org>2003-02-14 00:31:30 +0000
commit3807a1dadf1905567d70a7dd2b6344b884cf0ef7 (patch)
treec0ee9129678942cfc41fa354781b0ab8c554be6b
parent02da4c79444152a074d79e3b5b8b293a0b61ea1b (diff)
downloadsamba-3807a1dadf1905567d70a7dd2b6344b884cf0ef7.tar.gz
samba-3807a1dadf1905567d70a7dd2b6344b884cf0ef7.tar.bz2
samba-3807a1dadf1905567d70a7dd2b6344b884cf0ef7.zip
Mop and bucket for trusted domain enumeration fix.
(This used to be commit 5cfb30551a713caa3d69406450c1eac4541a30fa)
-rw-r--r--source3/nsswitch/winbindd.c2
-rw-r--r--source3/nsswitch/winbindd_util.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index b70a4dd3b4..b0b3acff8f 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -529,7 +529,7 @@ static void process_loop(void)
/* rescan the trusted domains list. This must be done
regularly to cope with transitive trusts */
- rescan_trusted_domains();
+ rescan_trusted_domains(False);
/* Free up temporary memory */
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 7a5fa3be20..99b94eac47 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -146,7 +146,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
/*
rescan our domains looking for new trusted domains
*/
-void rescan_trusted_domains(void)
+void rescan_trusted_domains(BOOL force)
{
struct winbindd_domain *domain;
TALLOC_CTX *mem_ctx;
@@ -157,11 +157,12 @@ void rescan_trusted_domains(void)
if (!lp_allow_trusted_domains()) {
return;
}
-
- /* ony rescan every few minutes */
- if ((unsigned)(t - last_scan) < WINBINDD_RESCAN_FREQ) {
+
+ /* Only rescan every few minutes but force if necessary */
+
+ if (((unsigned)(t - last_scan) < WINBINDD_RESCAN_FREQ) && !force)
return;
- }
+
last_scan = t;
DEBUG(1, ("scanning trusted domain list\n"));
@@ -217,7 +218,7 @@ BOOL init_domain_list(void)
cache_methods.alternate_name(domain);
/* do an initial scan for trusted domains */
- rescan_trusted_domains();
+ rescan_trusted_domains(True);
return True;
}