From 27c377dd04f40e4d0a7e11daad059939e94d9367 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 4 Mar 2008 01:54:09 +0000 Subject: [BZ #5818] * nscd/connections.c (dbs): Add initializers for .suggested_module. (verify_persistent_db): Remove one unnecessary test and add a new one for bad configuration. (nscd_init): Improve error reported when persistent database cannot be reused. * nscd/nscd.h (DEFAULT_SUGGESTED_MODULE): Define. * nscd/nscd_conf.c (nscd_parse_file): Provide default values for .suggested_module and .max_db_size and case config file says the values are zero. * nscd/nscd_helper.c (get_mapping): Fail if hash table module is zero. --- nscd/nscd_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nscd/nscd_helper.c') diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c index 866535200f..9828a46df0 100644 --- a/nscd/nscd_helper.c +++ b/nscd/nscd_helper.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1998-2002,2003,2004,2005,2006,2007 - Free Software Foundation, Inc. +/* Copyright (C) 1998-2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -339,6 +338,9 @@ get_mapping (request_type type, const char *key, if (__builtin_expect (head->version != DB_VERSION, 0) || __builtin_expect (head->header_size != sizeof (*head), 0) + /* Catch some misconfiguration. The server should catch + them now but some older versions did not. */ + || __builtin_expect (head->module == 0, 0) /* This really should not happen but who knows, maybe the update thread got stuck. */ || __builtin_expect (! head->nscd_certainly_running -- cgit v1.2.3