Mop and bucket for trusted domain enumeration fix.
authorTim Potter <tpot@samba.org>
Fri, 14 Feb 2003 00:31:30 +0000 (00:31 +0000)
committerTim Potter <tpot@samba.org>
Fri, 14 Feb 2003 00:31:30 +0000 (00:31 +0000)
(This used to be commit 5cfb30551a713caa3d69406450c1eac4541a30fa)

source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_util.c

index b70a4dd3b4039fda8b8989930f803cb626b1288e..b0b3acff8f8d0bfa2955f5f0af51b875a439209a 100644 (file)
@@ -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 */
 
index 7a5fa3be2099a35bc589a73c8079ec178f27d18f..99b94eac47cdc4e3fd7d584758a3862c86c21f69 100644 (file)
@@ -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;
 }