svn commit: samba r14474 - branches/SAMBA_3_0/source/nsswitch
trunk/source/nsswitch
gd at samba.org
gd at samba.org
Thu Mar 16 13:37:24 GMT 2006
Author: gd
Date: 2006-03-16 13:37:23 +0000 (Thu, 16 Mar 2006)
New Revision: 14474
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14474
Log:
Also flush the nscd caches before entering the main winbindd loop.
Guenther
Modified:
branches/SAMBA_3_0/source/nsswitch/winbindd.c
branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
trunk/source/nsswitch/winbindd.c
trunk/source/nsswitch/winbindd_dual.c
trunk/source/nsswitch/winbindd_util.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -1078,6 +1078,8 @@
init_idmap_child();
+ winbindd_flush_nscd_cache();
+
/* Loop waiting for requests */
while (1)
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -570,23 +570,8 @@
/* 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)));
- }
+ winbindd_flush_nscd_cache();
- ret = nscd_flush_cache("group");
- if (ret) {
- DEBUG(5,("failed to flush nscd cache for 'group' service: %s\n",
- strerror(ret)));
- }
- }
-#endif
-
/* Mark everything online - delete any negative cache entries
to force an immediate reconnect. */
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_util.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_util.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -1215,3 +1215,25 @@
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
+}
+
Modified: trunk/source/nsswitch/winbindd.c
===================================================================
--- trunk/source/nsswitch/winbindd.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ trunk/source/nsswitch/winbindd.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -1078,6 +1078,8 @@
init_idmap_child();
+ winbindd_flush_nscd_cache();
+
/* Loop waiting for requests */
while (1)
Modified: trunk/source/nsswitch/winbindd_dual.c
===================================================================
--- trunk/source/nsswitch/winbindd_dual.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ trunk/source/nsswitch/winbindd_dual.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -570,23 +570,8 @@
/* 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)));
- }
+ winbindd_flush_nscd_cache();
- ret = nscd_flush_cache("group");
- if (ret) {
- DEBUG(5,("failed to flush nscd cache for 'group' service: %s\n",
- strerror(ret)));
- }
- }
-#endif
-
/* Mark everything online - delete any negative cache entries
to force an immediate reconnect. */
Modified: trunk/source/nsswitch/winbindd_util.c
===================================================================
--- trunk/source/nsswitch/winbindd_util.c 2006-03-16 13:19:31 UTC (rev 14473)
+++ trunk/source/nsswitch/winbindd_util.c 2006-03-16 13:37:23 UTC (rev 14474)
@@ -1215,3 +1215,25 @@
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
+}
+
More information about the samba-cvs
mailing list