summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nsswitch/winbindd.c10
-rw-r--r--source3/nsswitch/winbindd_util.c33
2 files changed, 33 insertions, 10 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index e6a1c8290b..6a0056f917 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -570,15 +570,9 @@ static void process_loop(void)
message_dispatch();
-#if 0
- /* not needed any more since we use a single RPC to
- get transitive trusts --jerry
-
- rescan the trusted domains list. This must be done
- regularly to cope with transitive trusts */
+ /* refresh the trusted domain cache */
- rescan_trusted_domains(False);
-#endif
+ rescan_trusted_domains();
/* Free up temporary memory */
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 95dff84769..e5cb87ee75 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -144,10 +144,39 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
return domain;
}
+/********************************************************************
+ Periodcially we need to refresh the trusted domain cache for smbd
+********************************************************************/
-/*
+void rescan_trusted_domains( void )
+{
+ static time_t last_scan;
+ time_t now = time(NULL);
+ struct winbindd_domain *mydomain = NULL;
+
+ /* see if the time has come... */
+
+ if ( (now > last_scan) && ((now-last_scan) < WINBINDD_RESCAN_FREQ) )
+ return;
+
+ /* get the handle for our domain */
+
+ if ( (mydomain = find_domain_from_name(lp_workgroup())) == NULL ) {
+ DEBUG(0,("rescan_trusted_domains: Can't find my own domain!\n"));
+ return;
+ }
+
+ /* this will only add new domains we didn't already know about */
+
+ add_trusted_domains( mydomain );
+
+ return;
+}
+
+/********************************************************************
rescan our domains looking for new trusted domains
- */
+********************************************************************/
+
void add_trusted_domains( struct winbindd_domain *domain )
{
TALLOC_CTX *mem_ctx;