IDMAP_LIBS=@IDMAP_LIBS@
KRB5LIBS=@KRB5_LIBS@
LDAP_LIBS=@LDAP_LIBS@
+NSCD_LIBS=@NSCD_LIBS@
INSTALLCMD=@INSTALL@
INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
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.
AC_SUBST(EXTRA_SBIN_PROGS)
AC_SUBST(EXTRA_ALL_TARGETS)
AC_SUBST(CONFIG_LIBS)
+AC_SUBST(NSCD_LIBS)
# Set defaults
PIE_CFLAGS=""
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)
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"));
/* 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. */