diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-09 23:59:42 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-09 23:59:42 +0000 |
commit | fddb4f4c04473a60a97212c0c8e143d6a4d68380 (patch) | |
tree | 47463c89bdb909cbfa96f82a99a3897c92ce485a /source/nsswitch/winbindd.c | |
parent | fa1e7a62acdbcc550e6b29dc69454dcf7472210d (diff) | |
download | samba-fddb4f4c04473a60a97212c0c8e143d6a4d68380.tar.gz samba-fddb4f4c04473a60a97212c0c8e143d6a4d68380.tar.xz samba-fddb4f4c04473a60a97212c0c8e143d6a4d68380.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.
Diffstat (limited to 'source/nsswitch/winbindd.c')
-rw-r--r-- | source/nsswitch/winbindd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index c1402dc8fb6..0db16b6874f 100644 --- a/source/nsswitch/winbindd.c +++ b/source/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. */ |