summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-25 21:45:57 +0000
committerGerald Carter <jerry@samba.org>2003-08-25 21:45:57 +0000
commit6e090f1d7d4bc94cd0bc20e3502741621b6e2106 (patch)
tree88264057e973ad8721d20a4bd9b3c52918945ccb /source3
parent93ccb7b817c1eefcf030fb1eca6bd0c6fc2f1138 (diff)
downloadsamba-6e090f1d7d4bc94cd0bc20e3502741621b6e2106.tar.gz
samba-6e090f1d7d4bc94cd0bc20e3502741621b6e2106.tar.bz2
samba-6e090f1d7d4bc94cd0bc20e3502741621b6e2106.zip
make sure we keep the trusted domain cache up to date
(This used to be commit 3324adcaceb9191b5d4d671ac9b51c85c6714598)
Diffstat (limited to 'source3')
-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;