diff options
author | Bo Yang <boyang@samba.org> | 2010-02-09 16:35:40 +0800 |
---|---|---|
committer | Bo Yang <boyang@samba.org> | 2010-02-09 17:06:14 +0800 |
commit | 9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50 (patch) | |
tree | e93279836fd01bf6fe0719fc1928e90b5806c0db /source3/winbindd/winbindd.c | |
parent | 8c8bb51de1ac2baa46ac0736fae12c034288e5d4 (diff) | |
download | samba-9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50.tar.gz samba-9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50.tar.bz2 samba-9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50.zip |
s3: Don't invalidate cache for uninitialized domains.
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd.c')
-rw-r--r-- | source3/winbindd/winbindd.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index c0b42b811d..e4c22a610a 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -141,6 +141,29 @@ static void flush_caches(void) } } +static void flush_caches_noinit(void) +{ + /* + * We need to invalidate cached user list entries on a SIGHUP + * otherwise cached access denied errors due to restrict anonymous + * hang around until the sequence number changes. + * NB + * Skip uninitialized domains when flush cache. + * If domain is not initialized, it means it is never + * used or never become online. look, wcache_invalidate_cache() + * -> get_cache() -> init_dc_connection(). It causes a lot of traffic + * for unused domains and large traffic for primay domain's DC if there + * are many domains.. + */ + + if (!wcache_invalidate_cache_noinit()) { + DEBUG(0, ("invalidating the cache failed; revalidate the cache\n")); + if (!winbindd_cache_validate_and_initialize()) { + exit(1); + } + } +} + /* Handle the signal by unlinking socket and exiting */ static void terminate(bool is_parent) @@ -254,7 +277,7 @@ static void winbindd_sig_hup_handler(struct tevent_context *ev, const char *file = (const char *)private_data; DEBUG(1,("Reloading services after SIGHUP\n")); - flush_caches(); + flush_caches_noinit(); reload_services_file(file); } |