From 31842f5d017f01922cec306f7bfa2fa0fe748ca2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Dec 2001 23:59:42 +0000 Subject: 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) --- source3/nsswitch/winbindd_ads.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source3/nsswitch/winbindd_ads.c') 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 */ -- cgit