diff options
author | Günther Deschner <gd@samba.org> | 2006-03-13 15:13:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:15:24 -0500 |
commit | b97a69dce316ba8808b317acd99d976c4c279a28 (patch) | |
tree | 7ef0bd7d45da9f17bfc43a49d829b0cd4bc1b356 /source3 | |
parent | b372fd2cff0ba27db9a2e34a6bea15f1d0db9495 (diff) | |
download | samba-b97a69dce316ba8808b317acd99d976c4c279a28.tar.gz samba-b97a69dce316ba8808b317acd99d976c4c279a28.tar.bz2 samba-b97a69dce316ba8808b317acd99d976c4c279a28.zip |
r14321: When we have libnscd and winbindd comes (back) online, try to flush the
nscd caches so that NSS-calls can deliver accurate information.
Guenther
(This used to be commit a32a423a0e9e0d4dd21282fd528bcd3247fddbd1)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 3 | ||||
-rw-r--r-- | source3/configure.in | 3 | ||||
-rw-r--r-- | source3/nsswitch/winbindd.h | 4 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_dual.c | 16 |
4 files changed, 25 insertions, 1 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index c178fbaa85..a6cc3d8255 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -35,6 +35,7 @@ PASSDB_LIBS=@PASSDB_LIBS@ 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/librpc_echo.@SHLIBEXT@: $(RPC_ECHO_OBJ) bin/winbindd@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. diff --git a/source3/configure.in b/source3/configure.in index fd1648010d..7369b07959 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -266,6 +266,7 @@ AC_SUBST(UNINSTALL_CIFSMOUNT) 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 @@ if test x"$with_ads_support" != x"no"; then 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) 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. */ |