summary refs log tree commit diff
path: root/nscd
diff options
context:
space:
mode:
Diffstat (limited to 'nscd')
-rw-r--r--nscd/Makefile3
-rw-r--r--nscd/nscd.c11
-rw-r--r--nscd/nscd_getai.c1
-rw-r--r--nscd/nscd_getgr_r.c1
-rw-r--r--nscd/nscd_gethst_r.c1
-rw-r--r--nscd/nscd_getpw_r.c1
-rw-r--r--nscd/nscd_initgroups.c1
7 files changed, 10 insertions, 9 deletions
diff --git a/nscd/Makefile b/nscd/Makefile
index 26cc610fe1..a40a455267 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -66,6 +66,8 @@ include ../Rules
 CFLAGS-nscd_getpw_r.c = -fexceptions
 CFLAGS-nscd_getgr_r.c = -fexceptions
 CFLAGS-nscd_gethst_r.c = -fexceptions
+CFLAGS-nscd_getai.c = -fexceptions
+CFLAGS-nscd_initgroups.c = -fexceptions
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 CFLAGS-nscd.c = -fpie
@@ -89,7 +91,6 @@ CFLAGS-mem.c = -fpie
 CFLAGS-nscd_setup_thread.c = -fpie
 CFLAGS-aicache.c = -fpie
 CFLAGS-selinux.c = -fpie
-CFLAGS-nscd_initgroups.c = -fpie
 CFLAGS-initgrcache.c = -fpie
 
 $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 3fb5ad4691..146f61cb25 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -430,9 +430,14 @@ termination_handler (int signum)
 
   /* Synchronize memory.  */
   for (int cnt = 0; cnt < lastdb; ++cnt)
-    if (dbs[cnt].persistent)
-      // XXX async OK?
-      msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC);
+    {
+      /* Make sure nobody keeps using the database.  */
+      dbs[cnt].head->timestamp = 0;
+
+      if (dbs[cnt].persistent)
+	// XXX async OK?
+	msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC);
+    }
 
   /* Shutdown the SELinux AVC.  */
   if (selinux_enabled)
diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c
index e717dd85a0..a683976d87 100644
--- a/nscd/nscd_getai.c
+++ b/nscd/nscd_getai.c
@@ -39,7 +39,6 @@ libc_locked_map_ptr (map_handle);
    handling.  */
 libc_freeres_fn (ai_map_free)
 {
-
   if (map_handle.mapped != NO_MAPPING)
     free (map_handle.mapped);
 }
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c
index 9e8170f0f2..1b94bf584f 100644
--- a/nscd/nscd_getgr_r.c
+++ b/nscd/nscd_getgr_r.c
@@ -73,7 +73,6 @@ libc_locked_map_ptr (map_handle);
    handling.  */
 libc_freeres_fn (gr_map_free)
 {
-
   if (map_handle.mapped != NO_MAPPING)
     free (map_handle.mapped);
 }
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index 25553babf4..407be1441f 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -93,7 +93,6 @@ libc_locked_map_ptr (map_handle);
    handling.  */
 libc_freeres_fn (gr_map_free)
 {
-
   if (map_handle.mapped != NO_MAPPING)
     free (map_handle.mapped);
 }
diff --git a/nscd/nscd_getpw_r.c b/nscd/nscd_getpw_r.c
index 9af3858454..b04dcfaa99 100644
--- a/nscd/nscd_getpw_r.c
+++ b/nscd/nscd_getpw_r.c
@@ -72,7 +72,6 @@ libc_locked_map_ptr (map_handle);
    handling.  */
 libc_freeres_fn (gr_map_free)
 {
-
   if (map_handle.mapped != NO_MAPPING)
     free (map_handle.mapped);
 }
diff --git a/nscd/nscd_initgroups.c b/nscd/nscd_initgroups.c
index c33c76dfb3..ea32ab6bcc 100644
--- a/nscd/nscd_initgroups.c
+++ b/nscd/nscd_initgroups.c
@@ -35,7 +35,6 @@ libc_locked_map_ptr (map_handle);
    handling.  */
 libc_freeres_fn (gr_map_free)
 {
-
   if (map_handle.mapped != NO_MAPPING)
     free (map_handle.mapped);
 }