aboutsummaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-30 08:27:48 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-30 08:27:48 +0000
commit74fef3bbcbaecddc5ce293e15f765860348c32a8 (patch)
treeae819b77079f7b35d4e52549b0e87c0b321be8b7 /nscd
parent0891f9706f4fc0951324b3a3f113f60191b96434 (diff)
downloadglibc-74fef3bbcbaecddc5ce293e15f765860348c32a8.tar
glibc-74fef3bbcbaecddc5ce293e15f765860348c32a8.tar.gz
glibc-74fef3bbcbaecddc5ce293e15f765860348c32a8.tar.bz2
glibc-74fef3bbcbaecddc5ce293e15f765860348c32a8.zip
Update.
* nscd/nscd.c (termination_handler): Reset timestamp so that client immediately stop using the database. (__nscd_drop_map_ref): Change second parameter to be a reference to * nscd/nscd.h: Add declaration of addinitgroups and
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);
}