r14474: Also flush the nscd caches before entering the main winbindd loop.
authorGünther Deschner <gd@samba.org>
Thu, 16 Mar 2006 13:37:23 +0000 (13:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:33 +0000 (11:15 -0500)
Guenther
(This used to be commit c81eb71834dc827db63c8adb3f816bbbe916473c)

source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_dual.c
source3/nsswitch/winbindd_util.c

index 59437f05c2fef86c543bbf345b017804f7033c3d..33ec9ded8371f0276512b12eaaed94203f61061d 100644 (file)
@@ -1078,6 +1078,8 @@ int main(int argc, char **argv)
 
        init_idmap_child();
 
+       winbindd_flush_nscd_cache();
+
        /* Loop waiting for requests */
 
        while (1)
index fc889eb8a9f30a293e63332e1927a814f152b22b..f70b2539d37ab179db6eaa354b18667691105908 100644 (file)
@@ -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. */
index 20f25a3954aef294027a2b7d988d4bd2cc37b8ce..ae5f826a887b2fccf9c0a2c55f1b2d634604bb89 100644 (file)
@@ -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
+}
+