summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_util.c
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/nsswitch/winbindd_util.c
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/nsswitch/winbindd_util.c')
-rw-r--r--source3/nsswitch/winbindd_util.c33
1 files changed, 31 insertions, 2 deletions
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;