mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r14474: Also flush the nscd caches before entering the main winbindd loop.
Guenther
(This used to be commit c81eb71834
)
This commit is contained in:
parent
ef115ff314
commit
962e42caa5
@ -1078,6 +1078,8 @@ int main(int argc, char **argv)
|
||||
|
||||
init_idmap_child();
|
||||
|
||||
winbindd_flush_nscd_cache();
|
||||
|
||||
/* Loop waiting for requests */
|
||||
|
||||
while (1)
|
||||
|
@ -570,22 +570,7 @@ 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 */
|
||||
int ret = nscd_flush_cache("passwd");
|
||||
if (ret) {
|
||||
DEBUG(5,("failed to flush nscd cache for 'passwd' service: %s\n",
|
||||
strerror(ret)));
|
||||
}
|
||||
|
||||
ret = nscd_flush_cache("group");
|
||||
if (ret) {
|
||||
DEBUG(5,("failed to flush nscd cache for 'group' service: %s\n",
|
||||
strerror(ret)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
winbindd_flush_nscd_cache();
|
||||
|
||||
/* Mark everything online - delete any negative cache entries
|
||||
to force an immediate reconnect. */
|
||||
|
@ -1215,3 +1215,25 @@ BOOL winbindd_upgrade_idmap(void)
|
||||
|
||||
return idmap_convert(idmap_name);
|
||||
}
|
||||
|
||||
void winbindd_flush_nscd_cache(void)
|
||||
{
|
||||
#ifdef HAVE_NSCD_FLUSH_CACHE
|
||||
|
||||
/* Flush nscd caches to get accurate new information */
|
||||
int ret = nscd_flush_cache("passwd");
|
||||
if (ret) {
|
||||
DEBUG(5,("failed to flush nscd cache for 'passwd' service: %s\n",
|
||||
strerror(ret)));
|
||||
}
|
||||
|
||||
ret = nscd_flush_cache("group");
|
||||
if (ret) {
|
||||
DEBUG(5,("failed to flush nscd cache for 'group' service: %s\n",
|
||||
strerror(ret)));
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user