summaryrefslogtreecommitdiff
path: root/nscd/nscd_stat.c
AgeCommit message (Collapse)Author
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-10-05nscd: Eliminate compilation time dependency in the build outputFlorian Weimer
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers
2015-01-29Initialize nscd stats data [BZ #17892]Siddhesh Poyarekar
The padding bytes in the statsdata struct are not initialized, due to which valgrind throws a warning: ==11384== Memcheck, a memory error detector ==11384== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==11384== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==11384== Command: nscd -d ==11384== Fri 25 Apr 2014 10:34:53 AM CEST - 11384: handle_request: request received (Version = 2) from PID 11396 Fri 25 Apr 2014 10:34:53 AM CEST - 11384: GETSTAT ==11384== Thread 6: ==11384== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==11384== at 0x4E4ACDC: send (in /lib64/libpthread-2.12.so) ==11384== by 0x11AF6B: send_stats (in /usr/sbin/nscd) ==11384== by 0x112F75: nscd_run_worker (in /usr/sbin/nscd) ==11384== by 0x4E439D0: start_thread (in /lib64/libpthread-2.12.so) ==11384== by 0x599AB6C: clone (in /lib64/libc-2.12.so) ==11384== Address 0x15708395 is on thread 6's stack Fix the warning by initializing the structure.
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2010-04-08Print reload count in nscd statistics.Ulrich Drepper
2005-11-182005-11-18 Paul Brook <paul@codesourcery.com>Roland McGrath
* nscd/grpcache.c: Include <sys/socket.h>. * nscd/nscd_stat.c: Likewise. * nscd/pwdcache.c: Likewise. * sysdeps/unix/sysv/linux/unlinkat.c: Include <stdlib.h>, <sysdep.h>.
2005-08-23* nscd/connection.c (DEFAULT_DATASIZE_PER_BUCKET): Move to nscd.h.Ulrich Drepper
(dbs): Initialize max_db_size fields. (nscd_init): When mapping the database, use max_db_size as the mapping size even if it is bigger than the file size. * nscd/mem.c (mempool_alloc): When resizing the file make sure the limit in max_db_size is not exceeded. Don't use mremap, just posix_fallocate is enough (according to Linus). Use posix_fallocate correctly. * nscd/nscd.conf: Add max-db-size parameters. * nscd/nscd.h (struct database_dyn): Add max_db_size field. Define DEFAULT_MAX_DB_SIZE and DEFAULT_DATASIZE_PER_BUCKET. Temporarily define TEMP_FAILURE_RETRY_VAL here. * nscd/nscd_conf.c (nscd_parse_file): Parse max-db-size parameter and add sanity checks for it. * nscd/aicache.c (addhstaiX): Use send with MSG_NOSIGNAL not write to send reply. * nscd/connection.c (writeall): Likewise. (handle_request): Likewise. * nscd/grpcache.c (cache_addgr): Likewise. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nscd/nscd.c (parse_opt): Likewise. * nscd/nscd_stat.c (send_stats): Likewise. (receive_print_stats): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise.
2005-08-09* nscd/nscd_stat.c (receive_print_stats): Really print values ofUlrich Drepper
thread number, paranoia, and restart interval the server is using.
2005-06-26* nscd/nscd_stat.c (receive_print_stats): Replace YESSTR/NOSTRUlrich Drepper
with own translation. * sunrpc/xdr.c (xdr_hyper, xdr_u_hyper): When decoding, cast t2 to uint32_t instead of ulong. * sunrpc/Makefile (tests): Add tst-xdrmem. * sunrpc/tst-xdrmem.c: New test.
2004-12-22(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper
2007-07-122.5-18.1Jakub Jelinek
2004-10-03Update.Ulrich Drepper
Dynamically create new threads if necessary. * nscd/connections.c (fd_ready): If no thread available for processing the request, create a new one unless the limit is reached. (start_threads): Check errors from pthread_create. * nscd/nscd.h: Declare max_nthreads. * nscd/nscd_conf.c: Parse max-nthreads entry. * nscd/nscd.conf: Add max-threads entry. * nscd/nscd_stat.c: Print current and maximum number of threads.
2004-10-03Update.Ulrich Drepper
Implement paranoia mode. * nscd/connections.c (nscd_init): Mark database and socket descriptors as close on exec. (restart): New function. (restart_p): New function. (nscd_run): Add missing descrement of nready in case readylist is empty. (main_loop_poll): Call restart_p and restart. (main_loop_epoll): Likewise. (begin_drop_privileges): Save original UID and GID. * nscd/nscd.c: Define new variables paranoia, restart_time, restart_interval, oldcwd, old_gid, old_uid. (main): Disable paranoia mode if we are not forking. (check_pid): When re-execing, the PID file contains the same PID as the current process. Do not fail in this case. * nscd/nscd.conf: Add paranoia and restart-interval entries. * nscd/nscd.h: Define RESTART_INTERVAL. Declare new variables. * nscd/nscd_conf.c: Parse paranoia and restart-internal configurations. * nscd/nscd_stat.c: Print paranoia and restart-internal values.
2004-09-17Update.Ulrich Drepper
2004-09-16 Ulrich Drepper <drepper@redhat.com> * configure.in: Add test for required SELinux features. * config.make.in: Add have-selinux entry. * config.h.in: Add HAVE_SELINUX entry. * nscd/Makefile (nscd-modules): Add selinux. (CFLAGS-selinux.c): Add -fpie. Define selinux-LIBS and use in link line. * nscd/connections.c (handle_request): Check access SELinux permissions before processing request. * nscd/nscd.c (main): Initialize selinux_enabled and stop avc thread. * nscd/nscd_stat.c: Transmit and print AVC statistics. * nscd/selinux.c: New file. * nscd/selinux.h: New file. 2004-09-16 Jakub Jelinek <jakub@redhat.com> * nscd/nscd_helper.c (__nscd_unmap, get_mapping): Use __munmap instead of munmap. * nscd/Makefile (CFLAGS-aicache.c): Set to -fpie. 2004-09-16 Thorsten Kukuk <kukuk@suse.de> * sysdeps/posix/getaddrinfo.c (gaih_inet): Check __nss_not_use_nscd_hosts variable if nscd should be used or not. 2004-09-16 Ulrich Drepper <drepper@redhat.com> * nscd/nscd_proto.h: Define NSS_NSCD_RETRY. Add __nscd_getai prototype. * nss/getXXbyYY_r.c: Remode definition of NSS_NSCD_RETRY. * nscd/nscd-client.h: Remove __nscd_getai prototype. * nscd/nscd_getai.c: Include nscd_proto.h. * elf/ldd.bash.in: Add support for SELinux environments. Patch by Stephen Smalley <sds@epoch.ncsc.mil>.
2004-09-13Update.Ulrich Drepper
2004-09-13 Thorsten Kukuk <kukuk@suse.de> * nscd/nscd_stat.c: Don't access dbs[cnt].head for disabled services. * nscd/nscd.init: Fix path to socket.
2004-09-10Update.Ulrich Drepper
2004-09-10 Ulrich Drepper <drepper@redhat.com> * nscd/nscd_stat.c: Improve output by also printing .shared and .persistent. * nscd/connections.c: Allow cache sharing to be really disabled.
2004-08-26Update.Ulrich Drepper
2004-08-26 Ulrich Drepper <drepper@redhat.com> * nscd/cache.c: Major rewrite. The data is now optionally kept in a mmaped memory region which is automatically mirrored on disk. This implements persistent data storage. The Memory handled needed to be completely revamped, it now uses a garbage collection mechanism instead of malloc. * nscd/connections.c: Likewise. * nscd/nscd.c: Likewise. * nscd/nscd.h: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/nscd_stat.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c:: Likewise. * nscd/pwdcache.c:: Likewise. * nscd/Makefile: Add rules to build mem.c. * nscd/mem.c: New file. * nscd/nscd.conf: Describe new configuration options.
2003-05-04Update.Ulrich Drepper
2003-05-03 Ulrich Drepper <drepper@redhat.com> * nscd/nscd.c (main): Parse config file right after parsing parameters. Then, if get_stats is true, call receive_print_stats. Drop parameter from nscd_init call. (get_stats): New variable. (parse_opt): Set get_stats, don't call receive_print_stats here. * nscd/nscd.h: Declare dbs, stat_user, and stat_uid. Adjust nscd_init prototype. * nscd/connections.c (stat_user, stat_uid): New variables. (dbs): Make global. (nscd_init): Don't read configuration file here. Drop parameter. (handle_request): Cleanup handling of non-database lookup requests. * nscd/nscd_conf.c (nscd_parse_file): Recognize stat-user entry. Get UID of the specified user. Use xstrdup instead of strdup. * nscd/nscd_stat.c (receive_print_stats): Check UID. If not zero, check stat_user. * nscd/Makefile (nscd-modules): Add xstrdup. * nscd/nscd.conf: Document stat-user entry. 2003-05-03 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/unix/sysv/linux/ia64/sysdep.h (__NR_semtimedop): Define if not defined.
2003-04-28Update.Ulrich Drepper
* nscd/connections.c (client_queued): New variable. (nscd_run): Revamp the loop. Don't call poll except for cleanup threads. Keep track of the number of delays caused because of busy worker threads. * nscd/nscd.h: Declare client_queued. * nscd/nscd_stat.c: Transmit and print client_queued information.
2003-04-26Update.Ulrich Drepper
* nscd/cache.c (cache_search): Keep track of how many chain links we searched and update table statistics. (cache_add): Keep track of how many values are in the table. (prune_cache): Likewise. Keep track of locking success. Print messages about removed entries in separate pass. * nscd/connections.c (handle_request): Don't print debug message here. The caller will do it. Keep track of locking success. (nscd_run): Print debug message. Also print PID of the client process. * nscd/nscd.c (start_time): New variable. (main): Remember start time. * nscd/nscd.h: Declare start_time. (struct database): Add more members for new statistics. * nscd/nscd_stat.c: Add support for sending, receiving, and printing of new statistics.
2001-07-06Update to LGPL v2.1.Andreas Jaeger
2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
1999-06-19Update.Ulrich Drepper
1999-06-18 Zack Weinberg <zack@rabi.columbia.edu> * include/features.h: Define new macros __GNUC_PREREQ and __GLIBC_PREREQ which can be used to test the version of gcc and glibc respectively. * assert/assert.h: Use __GNUC_PREREQ. * intl/libintl.h: Likewise. * math/complex.h: Likewise. * math/tgmath.h: Likewise. * misc/sys/cdefs.h: Likewise. * posix/sys/types.h: Likewise. * socket/sys/socket.h: Likewise. * string/bits/string2.h: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Likewise. 1999-06-18 Zack Weinberg <zack@rabi.columbia.edu> * include/libintl.h: Declare _libc_intl_domainname here. Define _ and N_ here. * include/libc-symbols.h: Don't include <libintl.h>. Don't define _ and N_. Don't declare _libc_intl_domainname. * Makeconfig (CPPFLAGS): Use -imacros to read libc-symbols.h. * db2/config.h: Don't include sys/stat.h or define HAVE_ST_BLKSIZE here... * db2/compat.h: ...do it here. * linuxthreads/internals.h: Include bits/libc-tsd.h after all other headers. * linuxthreads/no-tsd.c: Include sys/cdefs.h for __P. * iconv/iconv.c: Include stddef.h for NULL. * malloc/malloc.h: Include features.h. * sysdeps/generic/morecore.c: Use __malloc_ptr_t not __ptr_t. * sysdeps/unix/make_errlist.c: Write an "#include <libintl.h>" into the generated file. * sysdeps/gnu/errlist.awk: Likewise. * sysdeps/gnu/errlist.c: Rebuilt. * assert/assert-perr.c: Include libintl.h. * assert/assert.c: Likewise. * elf/dl-open.c: Likewise. * elf/dlsym.c: Likewise. * elf/dlvsym.c: Likewise. * iconv/iconv_prog.c: Likewise. * inet/rcmd.c: Likewise. * inet/ruserpass.c: Likewise. * locale/programs/charset.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/repertoire.c: Likewise. * login/programs/database.c: Likewise. * login/programs/request.c: Likewise. * malloc/mcheck.c: Likewise. * misc/error.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nis_error.c: Likewise. * nis/nis_local_names.c: Likewise. * nis/nis_print.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * nis/ypclnt.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/nscd_stat.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/id.c: Likewise. * resolv/herror.c: Likewise. * stdio-common/psignal.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/clnt_unix.c: Likewise. * sunrpc/get_myaddr.c: Likewise. * sunrpc/pm_getmaps.c: Likewise. * sunrpc/pmap_clnt.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/rpc_main.c: Likewise. * sunrpc/rpc_scan.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/svc_unix.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * sysdeps/mach/hurd/mips/dl-machine.c: Likewise. * sysdeps/posix/gai_strerror.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c: Likewise. * timezone/zic.c: Likewise.
1998-10-18Update.Ulrich Drepper
1998-10-18 Ulrich Drepper <drepper@cygnus.com> * resolv/nss_dns/dns-host.c: Add missing errnop parameter to the NSS functions. * resolv/nss_dns/dns-network.c: Likewise. * grp/Makefile: Don't search for linuxhtreads in add-ons, use have-thread-library to determine whether threads are available. * pwd/Makefile: Remove wrong comment. * inet/Makefile: Define CFLAGS-gethstbyad_r.c, CFLAGS-gethstbynm_r.c, and CFLAGS-gethstbynm2_r.c to -DUSE_NSCD=1. * locale/C-messages.c: Define default strings for YESTR and NOSTR. * nss/Versions: Add __nss_hosts_lookup. * nss/getXXbyYY.c: Remove unneeded assignment. * nss/getXXbyYY_r.c: Include nscd/nscd_proto.h only if needed. Almost complete rewrite of the NSCD to make it smaller, faster, add more functionnality and make it easier to extend. * nscd/Makfile (routines): Add nscd_gethst_r. (nscd-modules): Add hstcache, gethstbyad_r, gethstbynm2_r, and cache. * nscd/cache.c: New file. * nscd/gethstbyad_r.c: New file. * nscd/gethstbynm2_r.c: New file. * nscd/hstcache.c: New file. * nscd/nscd_gethst_r.c: New file. * nscd/connections.c: Rewritten. Don't start new thread for every new connection. Use a fixed set of threads which handle all connections and also the cache cleanup. * nscd/grpcache.c: Rewritten to use generic cache handling functions in cache.c. * nscd/nscd.c: Recognize new parameter nthreads. Adjust initialization for rewrite. Remove handle_requests function. * nscd/nscd.h (NSCD_VERSION): Bump to 2. Define new data structure for the new unified cache and the host database entries. * nscd/nscd_conf.c: Rewrite parsing partly to allow adding of more databases easily. Recognize check-files and threads definitions. * nscd/nscd.conf: Add definition of enable-cache and check-files to passwd and group definitions. Add new set of definitions for hosts. * nscd/nscd_getgr_r.c: Rewrite for new protocol. * nscd/nscd_getpw_r.c: Likewise. * nscd/nscd_proto.h: Add prototype for host database functions. * nscd/nscd_stat.c: Rewrite to simplify printing of information for many databases. * nscd/dbg_log.c: Remove unnecessary variable initializations. Global variable debug_flag is renamed to dbg_level. * nscd/dbg_log.h: Declare set_logfile.
1998-01-31Update.Ulrich Drepper
1998-01-31 Phil Blundell <philb@gnu.org> * configure.in: Add --without-cvs option to suppress automatic checkin of regenerated files. * config.make: Likewise. * Makefile: Respect with-cvs setting. * Makerules: Likewise. * configure.in: Allow the standalone ARM port to be configured. 1998-01-31 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * grp/getgrgid_r.c: Define USE_NSCD. * grp/getgrnam_r.c: Likewise. * pwd/getpwuid_r.c: Likewise. * pwd/getpwnam_r.c: Likewise. * sysdeps/unix/inet/Subdirs: Add nscd subdir. * nss/getXXbyYY_r.c: Try at first nscd. * nscd/Makefile: New, for the Name Switch Cache Daemon (nscd). * nscd/connections.c: New file. * nscd/dbg_log.c: New file. * nscd/dbg_log.h: New file. * nscd/grpcache.c: New file. * nscd/nscd.c: New file. * nscd/nscd.h: New file. * nscd/nscd_conf.c: New file. * nscd/nscd_stat.c: New file. * nscd/pwdcache.c: New file. * nscd/nscd_getgr_r.c: New, client code, linked into libc. * nscd/nscd_getpw_r.c: Likewise. * nscd/nscd_proto.h: New, prototypes for client functions. * nscd/nscd.conf: New, example for a configuration file. * nscd/nscd.init: New, example for a startup script. * nscd/getgrgid_r.c: Old grp/getgrgid_r version, used from nscd to avoid deadlocks. * nscd/getgrnam_r.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nis/nis_cache.c: New file. * nis/nis_cache2.h: New file. * nis/nis_cache2_xdr.c: New file.