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.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'source3/nsswitch/winbindd.c') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index c1402dc8fb..0db16b6874 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -29,6 +29,7 @@ extern pstring debugf; struct winbindd_cli_state *client_list; static int num_clients; +BOOL opt_nocache; /* Reload configuration */ @@ -132,7 +133,6 @@ static void print_winbindd_status(void) { winbindd_status(); winbindd_idmap_status(); - winbindd_cache_status(); winbindd_cm_status(); } @@ -140,9 +140,8 @@ static void print_winbindd_status(void) static void flush_caches(void) { - /* Clear cached user and group enumation info */ - - winbindd_flush_cache(); + /* Clear cached user and group enumation info */ + wcache_flush_cache(); } /* Handle the signal by unlinking socket and exiting */ @@ -748,23 +747,25 @@ int main(int argc, char **argv) /* Initialise samba/rpc client stuff */ - while ((opt = getopt(argc, argv, "id:s:")) != EOF) { + while ((opt = getopt(argc, argv, "id:s:n")) != EOF) { switch (opt) { - /* Don't become a daemon */ - + /* Don't become a daemon */ case 'i': interactive = True; break; - /* Run with specified debug level */ + /* disable cacheing */ + case 'n': + opt_nocache = True; + break; + /* Run with specified debug level */ case 'd': new_debuglevel = atoi(optarg); break; /* Load a different smb.conf file */ - case 's': pstrcpy(dyn_CONFIGFILE,optarg); break; @@ -823,8 +824,6 @@ int main(int argc, char **argv) if (!winbindd_idmap_init()) return 1; - winbindd_cache_init(); - /* Unblock all signals we are interested in as they may have been blocked by the parent process. */ -- cgit