diff options
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd.h | 4 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_dual.c | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd.h b/source3/nsswitch/winbindd.h index e81102571c..6a220438a9 100644 --- a/source3/nsswitch/winbindd.h +++ b/source3/nsswitch/winbindd.h @@ -29,6 +29,10 @@ #include "winbindd_nss.h" +#ifdef HAVE_LIBNSCD +#include "libnscd.h" +#endif + #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c index 7864254c46..b77f499799 100644 --- a/source3/nsswitch/winbindd_dual.c +++ b/source3/nsswitch/winbindd_dual.c @@ -559,6 +559,7 @@ static void child_msg_offline(int msg_type, struct process_id src, void *buf, si static void child_msg_online(int msg_type, struct process_id src, void *buf, size_t len) { struct winbindd_domain *domain; + int ret; DEBUG(5,("child_msg_online received.\n")); @@ -570,6 +571,21 @@ static void child_msg_online(int msg_type, struct process_id src, void *buf, siz /* Set our global state as online. */ set_global_winbindd_state_online(); +#ifdef HAVE_NSCD_FLUSH_CACHE + /* Flush nscd caches to get accurate new information */ + ret = nscd_flush_cache("passwd"); + if (ret) { + DEBUG(5,("failed to flush nscd cache for 'passwd' service: %s\n", + error_message(ret))); + } + + ret = nscd_flush_cache("group"); + if (ret) { + DEBUG(5,("failed to flush nscd cache for 'group' service: %s\n", + error_message(ret))); + } +#endif + /* Mark everything online - delete any negative cache entries to force an immediate reconnect. */ |