summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index e04ed977bb..2391566e6c 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3017,3 +3017,24 @@ int this_is_smp(void)
return 0;
#endif
}
+
+static void smb_nscd_flush_cache(const char *service)
+{
+#ifdef HAVE_NSCD_FLUSH_CACHE
+ if (!nscd_flush_cache(service)) {
+ DEBUG(10,("failed to flush nscd cache for '%s' service: %s. "
+ "Is nscd running?\n",
+ service, strerror(errno)));
+ }
+#endif
+}
+
+void smb_nscd_flush_user_cache(void)
+{
+ return smb_nscd_flush_cache("passwd");
+}
+
+void smb_nscd_flush_group_cache(void)
+{
+ return smb_nscd_flush_cache("group");
+}