diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-11-26 11:57:30 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-11-26 11:57:30 +0000 |
commit | 65643516d760c4e61ba6f4406f442f7e9bd10f2f (patch) | |
tree | 0cf648ed7049ddbcb66d7f7b722ca31aa74cd445 /source3/nsswitch/winbindd_util.c | |
parent | 585e8a8c02f78a072b98f681fda5748c3d9924ab (diff) | |
download | samba-65643516d760c4e61ba6f4406f442f7e9bd10f2f.tar.gz samba-65643516d760c4e61ba6f4406f442f7e9bd10f2f.tar.bz2 samba-65643516d760c4e61ba6f4406f442f7e9bd10f2f.zip |
Having waited for *way* too long, this is mimir's namecache and trusted domain
cache code.
This uses gencache, mimir's new caching code that stores at text-based cache
of various data.
Mimir has done a *lot* of work on this patch, and it is finally time to
get it in CVS.
Andrew Bartlett
(This used to be commit 47f3bfe9564e7f3aff60cefaefd599e0abb30a31)
Diffstat (limited to 'source3/nsswitch/winbindd_util.c')
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 5ad4bada37..c1bb5cec7c 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -178,7 +178,7 @@ void rescan_trusted_domains(void) int i; result = domain->methods->trusted_domains(domain, mem_ctx, &num_domains, - &names, &alt_names, &dom_sids); + &names, &alt_names, &dom_sids); if (!NT_STATUS_IS_OK(result)) { continue; } @@ -187,9 +187,12 @@ void rescan_trusted_domains(void) the access methods of its parent */ for(i = 0; i < num_domains; i++) { DEBUG(10,("Found domain %s\n", names[i])); - add_trusted_domain(names[i], - alt_names?alt_names[i]:NULL, - domain->methods, &dom_sids[i]); + add_trusted_domain(names[i], alt_names?alt_names[i]:NULL, + domain->methods, &dom_sids[i]); + + /* store trusted domain in the cache */ + trustdom_cache_store(names[i], alt_names ? alt_names[i] : NULL, + &dom_sids[i], t + WINBINDD_RESCAN_FREQ); } } @@ -209,8 +212,10 @@ BOOL init_domain_list(void) /* Add ourselves as the first entry */ domain = add_trusted_domain(lp_workgroup(), NULL, &cache_methods, NULL); - /* Now we *must* get the domain sid for our primary domain. Go into - a holding pattern until that is available */ + /* + * Now we *must* get the domain sid for our primary domain. Go into + * a holding pattern until that is available + */ result = cache_methods.domain_sid(domain, &domain->sid); while (!NT_STATUS_IS_OK(result)) { |