svn commit: samba r14321 - branches/SAMBA_3_0/source
branches/SAMBA_3_0/source/nsswitch trunk/source
trunk/source/nsswitch
gd at samba.org
gd at samba.org
Mon Mar 13 15:13:36 GMT 2006
Author: gd
Date: 2006-03-13 15:13:35 +0000 (Mon, 13 Mar 2006)
New Revision: 14321
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14321
Log:
When we have libnscd and winbindd comes (back) online, try to flush the
nscd caches so that NSS-calls can deliver accurate information.
Guenther
Modified:
branches/SAMBA_3_0/source/Makefile.in
branches/SAMBA_3_0/source/configure.in
branches/SAMBA_3_0/source/nsswitch/winbindd.h
branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
trunk/source/Makefile.in
trunk/source/configure.in
trunk/source/nsswitch/winbindd.h
trunk/source/nsswitch/winbindd_dual.c
Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===================================================================
--- branches/SAMBA_3_0/source/Makefile.in 2006-03-13 15:04:17 UTC (rev 14320)
+++ branches/SAMBA_3_0/source/Makefile.in 2006-03-13 15:13:35 UTC (rev 14321)
@@ -35,6 +35,7 @@
IDMAP_LIBS=@IDMAP_LIBS@
KRB5LIBS=@KRB5_LIBS@
LDAP_LIBS=@LDAP_LIBS@
+NSCD_LIBS=@NSCD_LIBS@
INSTALLCMD=@INSTALL@
INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
@@ -1180,7 +1181,7 @@
bin/winbindd at EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy
@echo "Linking $@"
@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
- @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
+ @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(NSCD_LIBS)
# Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind
# libraries. Add to the appropriate PICOBJ variable instead.
Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in 2006-03-13 15:04:17 UTC (rev 14320)
+++ branches/SAMBA_3_0/source/configure.in 2006-03-13 15:13:35 UTC (rev 14321)
@@ -266,6 +266,7 @@
AC_SUBST(EXTRA_SBIN_PROGS)
AC_SUBST(EXTRA_ALL_TARGETS)
AC_SUBST(CONFIG_LIBS)
+AC_SUBST(NSCD_LIBS)
# Set defaults
PIE_CFLAGS=""
@@ -3528,6 +3529,8 @@
LIBS="$ac_save_LIBS"
fi
+AC_CHECK_LIB_EXT(nscd, NSCD_LIBS, nscd_flush_cache)
+
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use automount)
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.h
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.h 2006-03-13 15:04:17 UTC (rev 14320)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.h 2006-03-13 15:13:35 UTC (rev 14321)
@@ -29,6 +29,10 @@
#include "winbindd_nss.h"
+#ifdef HAVE_LIBNSCD
+#include "libnscd.h"
+#endif
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-03-13 15:04:17 UTC (rev 14320)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c 2006-03-13 15:13:35 UTC (rev 14321)
@@ -559,6 +559,7 @@
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 @@
/* 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. */
Modified: trunk/source/Makefile.in
===================================================================
--- trunk/source/Makefile.in 2006-03-13 15:04:17 UTC (rev 14320)
+++ trunk/source/Makefile.in 2006-03-13 15:13:35 UTC (rev 14321)
@@ -35,6 +35,7 @@
IDMAP_LIBS=@IDMAP_LIBS@
KRB5LIBS=@KRB5_LIBS@
LDAP_LIBS=@LDAP_LIBS@
+NSCD_LIBS=@NSCD_LIBS@
INSTALLCMD=@INSTALL@
INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
@@ -1209,7 +1210,7 @@
bin/winbindd at EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy
@echo "Linking $@"
@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
- @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
+ @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(NSCD_LIBS)
# Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind
# libraries. Add to the appropriate PICOBJ variable instead.
Modified: trunk/source/configure.in
===================================================================
--- trunk/source/configure.in 2006-03-13 15:04:17 UTC (rev 14320)
+++ trunk/source/configure.in 2006-03-13 15:13:35 UTC (rev 14321)
@@ -266,6 +266,7 @@
AC_SUBST(EXTRA_SBIN_PROGS)
AC_SUBST(EXTRA_ALL_TARGETS)
AC_SUBST(CONFIG_LIBS)
+AC_SUBST(NSCD_LIBS)
# Set defaults
PIE_CFLAGS=""
@@ -3528,6 +3529,8 @@
LIBS="$ac_save_LIBS"
fi
+AC_CHECK_LIB_EXT(nscd, NSCD_LIBS, nscd_flush_cache)
+
#################################################
# check for automount support
AC_MSG_CHECKING(whether to use automount)
Modified: trunk/source/nsswitch/winbindd.h
===================================================================
--- trunk/source/nsswitch/winbindd.h 2006-03-13 15:04:17 UTC (rev 14320)
+++ trunk/source/nsswitch/winbindd.h 2006-03-13 15:13:35 UTC (rev 14321)
@@ -29,6 +29,10 @@
#include "winbindd_nss.h"
+#ifdef HAVE_LIBNSCD
+#include "libnscd.h"
+#endif
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
Modified: trunk/source/nsswitch/winbindd_dual.c
===================================================================
--- trunk/source/nsswitch/winbindd_dual.c 2006-03-13 15:04:17 UTC (rev 14320)
+++ trunk/source/nsswitch/winbindd_dual.c 2006-03-13 15:13:35 UTC (rev 14321)
@@ -559,6 +559,7 @@
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 @@
/* 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. */
More information about the samba-cvs
mailing list