From 74fef3bbcbaecddc5ce293e15f765860348c32a8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 30 Sep 2004 08:27:48 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++++-- nscd/Makefile | 3 ++- nscd/nscd.c | 11 ++++++++--- nscd/nscd_getai.c | 1 - nscd/nscd_getgr_r.c | 1 - nscd/nscd_gethst_r.c | 1 - nscd/nscd_getpw_r.c | 1 - nscd/nscd_initgroups.c | 1 - 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea2528adbc..f7c62ec69a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ 2004-09-30 Ulrich Drepper + * nscd/nscd.c (termination_handler): Reset timestamp so that + client immediately stop using the database. + * nscd/nscd-client.h (__nscd_get_map_ref): Drop volatile from last parameter. - (__nscd_drop_map_ref): Change second parameter to be a referenc to + (__nscd_drop_map_ref): Change second parameter to be a reference to a variable. Update variable when cycle count changed. * nscd/nscd_helper.c (__nscd_get_map_ref): Remove volatile here, too. * nscd/nscd_getai.c: Correctly use __nscd_drop_map_ref. Reinitialize @@ -12,7 +15,7 @@ * nscd/nscd_getpw_r.c: Likewise. * nscd/nscd_initgroups.c: Likewise. - * nscd/nscd.h: Add declaretion of addinitgroups and + * nscd/nscd.h: Add declaration of addinitgroups and readdinitgroups. 2004-09-30 Andreas Jaeger 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); }