summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_ads.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-09 23:59:42 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-09 23:59:42 +0000
commit31842f5d017f01922cec306f7bfa2fa0fe748ca2 (patch)
tree3a17ecc634f1079f60fcb81d05d3672d65b84aa0 /source3/nsswitch/winbindd_ads.c
parente3d171ff55c7afec6687616a3808637f2d4cf456 (diff)
downloadsamba-31842f5d017f01922cec306f7bfa2fa0fe748ca2.tar.gz
samba-31842f5d017f01922cec306f7bfa2fa0fe748ca2.tar.bz2
samba-31842f5d017f01922cec306f7bfa2fa0fe748ca2.zip
completely new winbindd cache infrastructure
this one looks like just another winbind backend, and has the following properties: - does -ve and +ve cacheing of all queries - can be disabled with -n switch to winbindd - stores all records packed, so even huge domains are not a problem for a complete cache - handles the server being down - uses sequence numbers for all entries This fixes a lot of problems with winbindd. Serving from cache is now *very* fast. (This used to be commit fddb4f4c04473a60a97212c0c8e143d6a4d68380)
Diffstat (limited to 'source3/nsswitch/winbindd_ads.c')
-rw-r--r--source3/nsswitch/winbindd_ads.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 2510e4a501..cabb482f7d 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -641,17 +641,20 @@ done:
}
/* find the sequence number for a domain */
-static uint32 sequence_number(struct winbindd_domain *domain)
+static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq)
{
- uint32 usn;
ADS_STRUCT *ads = NULL;
+ *seq = DOM_SEQUENCE_NONE;
+
ads = ads_cached_connection(domain);
- if (!ads) return DOM_SEQUENCE_NONE;
+ if (!ads) return NT_STATUS_UNSUCCESSFUL;
- if (!ads_USN(ads, &usn)) return DOM_SEQUENCE_NONE;
+ if (!ads_USN(ads, seq)) {
+ return NT_STATUS_UNSUCCESSFUL;
+ }
- return usn;
+ return NT_STATUS_OK;
}
/* the ADS backend methods are exposed via this structure */