summaryrefslogtreecommitdiff
path: root/nscd/connections.c
AgeCommit message (Collapse)Author
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-06-24Fix typo in commentSiddhesh Poyarekar
2013-06-11Fix handling of netgroup cache in nscdAndreas Schwab
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold
2013-02-08Refactor code out of nscd's two main poll loops.Carlos O'Donell
We refactor the inotify file checking code and the database clearing code out of the main_loop_poll and mail_loop_epoll functions. We document some the related functions with appropriate comments.
2013-02-07Remove lots of inline keywords.Roland McGrath
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-05-10Hurd: #include <kernel-features.h>Thomas Schwinge
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2011-11-01Use kernel headers for netlink definitionsUlrich Drepper
2011-10-31Cache network interface informationUlrich Drepper
Whenever getaddrinfo needed network interface information it used the netlink interface to read the information every single time. The problem is that this information can change at any time. The patch implements monitoring of the network interfaces through nscd. If no change is detected the previously read information can be reused (which is the norm). This timestamp information is also made available to other processes using the shared memory segment between nscd and those processes.
2011-10-07Implement caching of nscdUlrich Drepper
2011-10-07Don't unnecesarily use inotify in nscdUlrich Drepper
2011-07-11Generalize framework to register monitoring of files in nscdUlrich Drepper
nscd can clear caches when certain files change. The list of files was hardcoded so far and worked for nss_files and nss_dns and those modules which need no monitoring. nss_db, for instance, has its own set of files to monitor. Now the NSS modules themselves can request that certain files are monitored.
2011-04-22Remove doubled words.Jim Meyering
2011-02-05Schedule nscd cache pruning more accurately fromr re-added values.Ulrich Drepper
2009-11-22Try harder to re-exec nscd in paranoia mode.Ulrich Drepper
2009-04-26* nscd/connections.c (send_ro_fd): Define temporary variable to avoidUlrich Drepper
warning. * elf/sprof.c: Likewise.
2009-03-16* nscd/connections.c (restart): Try to preserve the process nameUlrich Drepper
by reading the /proc/self/exe symlink and using the return name. Patch by Jeff Bastian <jbastian@redhat.com>.
2009-02-13[BZ #5381]Ulrich Drepper
2009-02-13 Ulrich Drepper <drepper@redhat.com> [BZ #5381] * nscd/nscd.h: Remove definitions and declarations for mem_in_flight. Change mempool_alloc prototype. * nscd/mem.c (gc): Don't handle mem_in_flight. (mempool_alloc): Third parameter now only indicates whether this is the first call (to allocate data) or not. If it is, get db rdlock. Release it on error. Don't handle mem_in_flight. * nscd/aicache.c (addhstaiX): Mark he parameter as const. Adjust third parameter of mempool_alloc calls. Nothing to do here in case mempool_alloc fails. Avoid local variable shadowing parameter. No need to get db rdlock before calling cache_add. * nscd/cache.c (cache_add): Adjust call to mempool_alloc. There is no mem_in_flight array anymore. * nscd/connections.c: Remove definition and handling of mem_in_flight. * nscd/grpcache.c (cache_addgr): Adjust third parameter of mempool_alloc calls. Mark he parameter as const. Nothing to do here in case mempool_alloc fails. No need to get db rdlock before calling cache_add. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nscd/servicescache.c (cache_addserv): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. Remove some debugging code.
2009-01-28* nscd/connections.c (nscd_init): If database file access beUlrich Drepper
opened check whether this is due to permission problems and bail in that case.
2008-12-09[BZ #7067]Ulrich Drepper
2008-12-03 Petr Baudis <pasky@suse.cz> [BZ #7067] * nscd/connections.c (invalidate_cache): Use prune_run_lock instead of prune_lock. (nscd_run_prune): Before calling prune_cache, take prune_run_lock. * nscd/nscd.h (database_dyn): Add prune_run_cache.
2008-12-03* socket/sys/socket.h: Declare accept4.Ulrich Drepper
* socket/accept4.c: New file. * sysdeps/unix/sysv/linux/accept4.c: New file. * sysdeps/unix/sysv/linux/i386/accept4.S: New file. * socket/Makefile (routines): Add accept4. * socket/Versions: Export accept4 with version GLIBC_2.10. * socket/paccept.c: Removed. * sysdeps/unix/sysv/linux/paccept.c: Removed. * sysdeps/unix/sysv/linux/i386/paccept.S: Removed. * Versions.def: Define GLIBC_2.10 for libc. * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_ACCEPT4. * nscd/connections.c: Use accept4. * sysdeps/unix/sysv/linux/i386/socket.S: Fix comment.
2008-10-17* elf/Makefile: Add rules to build and run tst-tls17.cvs/fedora-glibc-20081019T1815Ulrich Drepper
* elf/tst-tls17.c: New test. * elf/tst-tlsmod17a.c: New file. * elf/tst-tlsmod17b.c: Likewise.
2008-09-30* nscd/connections.c: Disable use of paccept for now.Ulrich Drepper
2008-08-03(main_loop_poll): Pass a buffer which is guaranteed to be large enough to ↵Ulrich Drepper
read inotify event. Ignore EAGAIN error. Better error message. Add branch predicition. (main_loop_epoll): Likewise.
2008-07-30* nscd/connections.c (nscd_init): Type if preprocessor directive.Ulrich Drepper
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PACCEPT): Define.
2008-07-25* nscd/connections.c (nscd_init): Clean up fcntl call.Ulrich Drepper
2008-07-25* sysdeps/unix/sysv/linux/kernel-features.h: DefineUlrich Drepper
__ASSUME_PACCEPT, __ASSUME_IN_NONBLOCK, and __ASSUME_PACCEPT if appropriate. * nscd/connections.c: Avoid fcntl calls to set close-on-exec flag and non-blocking mode by using socket, paccept, and inotify_init1.
2008-07-12* nscd/connections.c (main_loop_poll): Fix handling of read errorsUlrich Drepper
from inotify. (main_loop_epoll): Likewise.
2008-06-18* nscd/connections.c (main_loop_poll): Fix test for read error.Ulrich Drepper
(main_loop_epoll): Likewise.
2008-06-13* nscd/connections.c: Also recognize and handle changes to theUlrich Drepper
resolver configuration file.
2008-06-12* nscd/nscd.h (struct database_dyn): Add inotify_descr and clear_cacheUlrich Drepper
fields. * nscd/connections.c (inotify_fd): New variable. (nscd_init): Try to open an inotify descriptor. If successful, watch files for databases using inotify instead of having prune threads stat the files. (nscd_run_prune): Recognize clear_cache flag being set and call prune_cache appropriately. (main_loop_poll): Add inotify descriptor to wait set and handle the reported changes. (main_loop_epoll): Likewise. * nscd/cache.c (prune_cache): Don't stat files for databases if inotify is used. * sysdeps/unix/sysv/linux/Makefile [subdir=nscd] (CFLAGS-connections.c): Add -DHAVE_INOTIFY.
2008-05-18* nscd/cache.c (cache_add): Take additional parameter specifyingUlrich Drepper
whether this is in response of a cache refill. Check alignment of package data. Revamp waking of pruning thread. (prune_cache): Small optimization. * nscd/nscd.h: Adjust cache_add prototypes. * nscd/aicache.c: Adjust cache_add calls. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/pwdcache.c: Likewise. * nscd/servicescache.c: Likewise. * nscd/connections.c (restart): Really disable cache use before exec attempt. If it fails, reenable cache. (nscd_run_prune): Initialize wakeup_time. After wakeup, set wakeup time to max to be able to notice concurrent cache additions. Unlock prune_lock while performing gc. Afterwards compute wakeup time with current wakeup_time value in mind.
2008-04-22* nscd/Makefile (nscd-cflags): Set back to -fpie.Ulrich Drepper
* nscd/nscd.h (mem_in_flight): Add attribute_tls_model_ie. * nscd/connections.c (mem_in_flight): Likewise. * nscd/nscd.h (dbs): Make hidden. * sysdeps/unix/sysv/linux/times.c (__times): Fix check for EFAULT. Avoid returning -1, return 0 instead.
2008-04-19[BZ #5209, BZ #5381]Ulrich Drepper
2008-04-15 Ulrich Drepper <drepper@redhat.com> [BZ #5209] * sysdeps/unix/sysv/linux/times.c: New file. [BZ #5381] * nscd/nscd.h: Define enum in_flight, mem_in_flight, and mem_in_flight_list variables. Add new parameter to mempool_alloc prototype. * nscd/mem.c (mempool_alloc): Take additional parameter. Initialize appropriate mem_in_flight element. (gc): Take allocations which have not yet been committed to the database into account. * nscd/cache.c (cache_add): Add new parameter to mempool_alloc call. Reset mem_in_flight before returning. * nscd/connections.c (nscd_run_worker): Initialize mem_in_flight and cue it up in mem_in_flight_list. * nscd/aicache.c: Adjust mempool_alloc call. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/pwdcache.c: Likewise. * nscd/servicescache.c: Likewise. * nscd/Makefile (nscd-flags): Until ld is fixed, use -fpic instead of -fpie. * nscd/connections.c (handle_request): Provide better error message in case SELinux forbids the service. * version.h (VERSION): Bump to 2.8.90.
2008-03-04[BZ #5818]Ulrich Drepper
* 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.
2008-01-05[BZ #5112] Jakub Jelinek
* nscd/connections.c (restart): Fix condition. 2008-01-05 Jakub Jelinek <jakub@redhat.com> [BZ #5112] * nscd/connections.c (restart): Fix condition.
2007-11-23[BZ #5382]Ulrich Drepper
* nscd/nscd.h (NSCD_THREAD_STACKSIZE): Define. * nscd/connections.c (start_threads): Use NSCD_THREAD_STACKSIZE. * nscd/mem.c (gc): Don't allocate arrays on stack if it can overflow it. * sysdeps/unix/sysv/linux/nscd_setup_thread.c (setup_thread): Return zero in case thread library is not NPTL.
2007-11-06* nscd/aicache.c (addhstaiX): Check herrno after IPv4 lookup onlyUlrich Drepper
when the lookup call failed. * nscd/nscd.h (struct database_dyn): Rename prunelock to prune_lock. Add prune_cond and wakeup_time. (CACHE_PRUNE_INTERNAL): Define. Update declarations of prune_cache and setup_thread. * nscd/connections.c (dbs): Update initializers. (CACHE_PRUNE_INTERNAL): Moved to nscd.h. (nscd_init): Default number of threads is now 4. (invalidate_cache): Take lock before calling prune_cache. (handle_request): If SELinux forbids the request, say so. (readylist_cond): Use static initializer. (nscd_run_prune): New function. Used only by pruning threads. (nscd_run_worder): Renamed from nscd_run. Remove support for pruning here. (fd_ready): Update nscd_run reference. (start_threads): No need to initialize readylist_cond. Start pruning threads separately. * nscd/nscd_setup_thread.c: Change return value type to int and always return 0. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Change return value type to int and return nonzero value if we can use the TID address hack. * nscd/cache.c (cache_add): If next wakeup time of cleanup thread for the database is later than the new entry's timeout, update the wakeup time and wake the cleanup thread. (prune_cache): Return seconds the next entry in the database is still valid. Remove locking for pruning here. * nscd/nscd.conf: Document default number of threads.
2007-10-07[BZ #3924]Ulrich Drepper
* sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Fix a few more little bugs in creating the stack frame when pltexit has to be called.
2007-10-06* nscd/connections.c (verify_persistent_db): Recognize circular lists.Ulrich Drepper
2007-10-05[BZ #5112]Ulrich Drepper
* nscd/connections.c (restart): Don't resync if database is disabled. Patch mostly by Brian De Wolf <bldewolf@csupomona.edu>.
2007-08-29* nscd/connections.c (send_ro_fd): Also transfer file size.Ulrich Drepper
* nscd/nscd_helper.c (get_mapping): If nscd also transfers the file size don't call fstat.
2007-08-22[BZ #4946]Ulrich Drepper
* nscd/connections.c (handle_request): Using sendfile always requires that mmap is used for the database. Patch by Petr Baudis <pasky@suse.cz>.
2007-08-11* nscd/connections.c: Use O_CLOEXEC is possible. Use mkostempUlrich Drepper
instead of mkstemp. * misc/Makefile (routines): Add mkostemp and mkostemp64. * misc/Versions: Export mkostemp and mkostemp64 for GLIBC_2.7. * misc/mkostemp.c: New file. * misc/mkostemp64.c: New file. * stdlib/stdlib.h: Declare the new functions. * sysdeps/posix/tempname.c: Add new parameter which is added to the flags for open. Remove __GT_BIGFILE handling. * stdio-common/tempname.c: Likewise. * include/stdio.h: Adjust __gen_tempname prototype. Renumber __GT_* constants. * libio/oldtmpfile.c: Adjust for __gen_tempname interface change. * misc/mkdtemp.c: Likewise. * misc/mkstemp.c: Likewise. * misc/mkstemp64.c: Likewise. * misc/mktemp.c: Likewise. * stdio-common/tempnam.c: Likewise. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise.
2007-07-16* elf/ldconfig.c: Allow GPLv2 or any later version.Roland McGrath
* elf/readlib.c: Likewise. * elf/chroot_canon.c: Likewise. * elf/cache.c: Likewise. * nscd/mem.c: Likewise. * nscd/getpwuid_r.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/aicache.c: Likewise. * nscd/getsrvbynm_r.c: Likewise. * nscd/nscd.c: Likewise. * nscd/servicescache.c: Likewise. * nscd/getsrvbypt_r.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/gethstbyad_r.c: Likewise. * nscd/gethstbynm2_r.c: Likewise. * nscd/getgrnam_r.c: Likewise. * nscd/nscd_setup_thread.c: Likewise. * nscd/getpwnam_r.c: Likewise. * nscd/gai.c: Likewise. * nscd/connections.c: Likewise. * nscd/dbg_log.c: Likewise. * nscd/cache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/getgrgid_r.c: Likewise. * nscd/pwdcache.c: Likewise. * catgets/gencat.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/locarchive.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/locfile-kw.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/xmalloc.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/simple-hash.c: Likewise. * locale/programs/xstrdup.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/locfile-kw.gperf: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/charmap-kw.gperf: Likewise. * locale/programs/charmap.h: Likewise. * locale/programs/charmap-kw.h: Likewise. * locale/programs/config.h: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/charmap.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/repertoire.h: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/3level.h: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/charmap-dir.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/localedef.h: Likewise. * locale/programs/charmap-dir.h: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/simple-hash.h: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/locale-spec.c: Likewise. * locale/programs/locfile-token.h: Likewise. * posix/getconf.c: Likewise. * iconv/dummy-repertoire.c: Likewise. * iconv/iconv_charmap.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c: Likewise. * malloc/memusagestat.c: Likewise. * sysdeps/unix/sysv/linux/nscd_setup_thread.c: Likewise.
2007-02-01* sysdeps/unix/sysv/linux/i386/sysdep.h (PTR_MANGLE): Roll value beforecvs/fedora-glibc-20070202T0923Ulrich Drepper
returning. (PTR_DEMANGLE): Real definition now that it's not the same as PRT_MANGLE anymore. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * string/strerror_l.c: New file. * string/Makefile (routines): Add strerror_l. * string/string.h: Declare strerror_l. * string/Versions: Export strerror_l for GLIBC_2.6. * nscd/connections.c (nscd_run): Don't define MAXKEYLEN here.
2007-01-16* nscd/connections.c (servinfo): Renamed to reqinfo. Change allUlrich Drepper
users. (handle_request): Remove unnecessary tests.
2007-01-15* nscd/connections.c (handle_request): Add a __builtin_expect.Ulrich Drepper