about summary refs log tree commit diff
path: root/nscd
Commit message (Collapse)AuthorAgeFilesLines
* [BZ #7067]Ulrich Drepper2008-12-092-2/+13
| | | | | | | | | 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.
* * socket/sys/socket.h: Declare accept4.Ulrich Drepper2008-12-031-19/+36
| | | | | | | | | | | | | | | | | * 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.
* * elf/Makefile: Add rules to build and run tst-tls17. cvs/fedora-glibc-20081019T1815Ulrich Drepper2008-10-171-0/+2
| | | | | | * elf/tst-tls17.c: New test. * elf/tst-tlsmod17a.c: New file. * elf/tst-tlsmod17b.c: Likewise.
* * nscd/connections.c: Disable use of paccept for now.Ulrich Drepper2008-09-301-1/+1
|
* (main_loop_poll): Pass a buffer which is guaranteed to be large enough to ↵Ulrich Drepper2008-08-031-6/+13
| | | | read inotify event. Ignore EAGAIN error. Better error message. Add branch predicition. (main_loop_epoll): Likewise.
* * nscd/connections.c (nscd_init): Type if preprocessor directive.Ulrich Drepper2008-07-301-1/+1
| | | | | * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PACCEPT): Define.
* * Makeconfig: Define pie-ccflag and PIE-ccflag variables.Ulrich Drepper2008-07-261-1/+1
| | | | | | * elf/Makefile: Use pie-ccflag variable. * nscd/Makefile: Likewise. * sysdeps/sparc/Makefile: Set $(pie-ccflag) to -fPIE.
* * nscd/connections.c (nscd_init): Clean up fcntl call.Ulrich Drepper2008-07-251-1/+1
|
* * nscd/nscd_helper.c (open_socket): Use SOCK_CLOEXEC andUlrich Drepper2008-07-251-3/+28
| | | | SOCK_NONBLOCK if possible.
* * sysdeps/unix/sysv/linux/kernel-features.h: DefineUlrich Drepper2008-07-251-22/+77
| | | | | | | __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.
* * nscd/connections.c (main_loop_poll): Fix handling of read errorsUlrich Drepper2008-07-121-29/+83
| | | | | from inotify. (main_loop_epoll): Likewise.
* * nscd/connections.c (main_loop_poll): Fix test for read error.Ulrich Drepper2008-06-181-2/+2
| | | | (main_loop_epoll): Likewise.
* * nscd/connections.c: Also recognize and handle changes to theUlrich Drepper2008-06-131-3/+25
| | | | resolver configuration file.
* * nscd/nscd.h (struct database_dyn): Add inotify_descr and clear_cacheUlrich Drepper2008-06-123-15/+132
| | | | | | | | | | | | | | | | | 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.
* * nscd/grpcache.c (cache_addgr): Correctly compute size of cvs/fedora-glibc-20080612T1619Ulrich Drepper2008-06-124-6/+27
| | | | | | | fixed-size portion of the record. * nscd/servicescache.c (cache_addserv): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise.
* * nscd/mem.c (gc): Initialize obstack earlier so that if we jumpUlrich Drepper2008-06-122-20/+31
| | | | | | | out we don't use uninitialized memory. * nscd/hstcache.c (cache_addhst): Send correct number of bytes to the client.
* * nscd/nscd_getserv_r.c (__nscd_getservbyport_r): Pass cp Jakub Jelinek2008-06-031-1/+1
| | | | | | | | | | instead of portstr to nscd_getserv_r. Patch by Roman Kagan <rkagan@mail.ru>. 2008-06-03 Jakub Jelinek <jakub@redhat.com> * nscd/nscd_getserv_r.c (__nscd_getservbyport_r): Pass cp instead of portstr to nscd_getserv_r. Patch by Roman Kagan <rkagan@mail.ru>.
* * nscd/cache.c (cache_add): Take additional parameter specifyingUlrich Drepper2008-05-189-42/+94
| | | | | | | | | | | | | | | | | | | 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.
* * nscd/mem.c (gc): Avoid stack overflow when allocating move list. cvs/fedora-glibc-20080518T1017Ulrich Drepper2008-05-181-2/+16
|
* * nscd/mem.c (gc): Correctly determine highest used array elementUlrich Drepper2008-05-181-3/+3
| | | | in mark.
* * nscd/mem.c (markrange): Add assert to check entries are allUlrich Drepper2008-05-181-1/+2
| | | | aligned. Small cleanup in bitmap use.
* * nscd/nscd.h (mem_in_flight): Replace blockaddr field withUlrich Drepper2008-05-182-11/+13
| | | | | | blockoff of type nscd_ssize_t. * nscd/mem.c (gc): Simplify markrange call for on-flight blocks. (mempoll_alloc): Record block offset and not address.
* * nscd/mem.c (gc): Fix test for stack overuse.Ulrich Drepper2008-05-181-2/+2
|
* * nscd/aicache.c (addhstaiX): Fix a few small problems, cleanups,Ulrich Drepper2008-05-171-18/+19
| | | | more asserts.
* * nscd/cache.c (cache_add): Before returning with failure and thisUlrich Drepper2008-05-116-74/+24
| | | | | | | | | | | is the first use of the record, mark it as unusable. * nscd/aicache.c: Don't touch the dataset after cache_add returns reporting a failure. * nscd/grpcache.c: Likewise * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/pwdcache.c: Likewise. * nscd/servicecache.c: Likewise.
* (cache_add): Before returning with failure and this is the first use of the ↵Ulrich Drepper2008-05-111-0/+5
| | | | record, mark it as unusable.
* * include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsendUlrich Drepper2008-05-101-200/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prototypes. * include/arpa/nameser_compat.h: Define T_UNSPEC. * nis/Versions (libnss_nis): Export _nss_nis_gethostbyname4_r. (libnss_nisplus): Export _nss_nisplus_gethostbyname4_r. * nis/nss_nis/nis-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_nis_gethostbyname4_r): New function. * nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_parse_hostent): Change to also handle af==AF_UNSPEC. (get_tablename): New function. Use it to avoid duplication. (_nss_nisplus_gethostbyname4_r): New function. * nscd/aicache.c (addhstaiX): Use gethostbyname4_r function is available. * nss/Versions (libnss_files): Export _nss_files_gethostbyname4_r. * nss/nss.h: Define struct gaih_addrtuple. * nss/nss_files/files-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_files_gethostbyname4_r): New function. * resolv/Versions (libnss_dns): Export _nss_dns_gethostbyname4_r. * resolv/gethnmaddr.c: Adjust __libc_res_nsearch and __libc_res_nquery calls. * resolv/res_query.c (__libc_res_nquery): Take two additional parameters for second answer buffer. Handle type=T_UNSPEC to mean look up IPv4 and IPv6. Change all callers. * resolv/res_send.c (__libc_res_nsend): Take five aditional parameters for an additional query and answer buffer. Pass to send_vc and send_dg. (send_vc): Send possibly two requests and receive two answers. (send_dg): Likewise. * resolv/nss_dns/dns-host.c: Adjust calls to __libc_res_nsearch and __libc_res_nquery. (_nss_dns_gethostbyname4_r): New function. (gaih_getanswer_slice): Likewise. (gaih_getanswer): Likewise. * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Adjust __libc_res_nquery call. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. (_nss_dns_getnetbyname_r): Adjust __libc_res_nsearch call. * sysdeps/posix/getaddrinfo.c: Use gethostbyname4_r function is available.
* * nscd/Makefile (nscd-cflags): Set back to -fpie.Ulrich Drepper2008-04-223-5/+4
| | | | | | | | | | * 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.
* [BZ #5209, BZ #5381]Ulrich Drepper2008-04-1911-34/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [BZ #5979]Ulrich Drepper2008-03-291-1/+1
| | | | | | | | | | | | | | | | | * sunrpc/auth_unix.c: Unify printed strings. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/clnt_unix.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/svc_unix.c: Likewise. * sunrpc/xdr.c: Likewise. * sunrpc/xdr_array.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * locale/programs/ld-time.c (time_finish): Unify messages. * locale/programs/locfile.c (handle_copy): Fix typo. * nscd/nscd.c (options): Fix typo.
* [BZ #5818]Ulrich Drepper2008-03-044-27/+37
| | | | | | | | | | | | | * 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.
* [BZ #5112] Jakub Jelinek2008-01-051-2/+3
| | | | | | | | * nscd/connections.c (restart): Fix condition. 2008-01-05 Jakub Jelinek <jakub@redhat.com> [BZ #5112] * nscd/connections.c (restart): Fix condition.
* * posix/getconf.c: Update copyright year.Ulrich Drepper2008-01-021-2/+2
| | | | | | | | | | | | | | | | | | * nss/getent.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c: Likewise. * elf/ldconfig.c: Likewise. * catgets/gencat.c: Likewise. * csu/version.c: Likewise. * elf/ldd.bash.in: Likewise. * elf/sprof.c (print_version): Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * nscd/nscd.c (print_version): Likewise. * debug/xtrace.sh: Likewise. * malloc/memusage.sh: Likewise. * malloc/mtrace.pl: Likewise. * debug/catchsegv.sh: Likewise.
* Declare fsync also for Unix98.Ulrich Drepper2007-11-261-1/+1
| | | | | | 2007-11-26 Ulrich Drepper <drepper@redhat.com> * posix/unistd.h: Declare fsync also for Unix98.
* Clear array before use.Ulrich Drepper2007-11-255-1/+11
| | | | | | | | * nscd/hstcache.c (cache_addhst): Likewise. * nscd/grpcache.c (cache_addgr): Likewise. * nscd/servicescache.c (cache_addserv): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise.
* * nscd/nscd.h (MAX_STACK_USE): Define.Ulrich Drepper2007-11-254-7/+33
| | | | | | | | | | * nscd/mem.c (MAX_STACK_USE): Remove definition here. (gc): Initialize stack_used based on allocation in prune_cache. * nscd/cache.c (prune_cache): Use heap for mark array if necessary. Clear array bfore use. * nscd/aicache.c (addhstaiX): Update statistics counter in case memory allocate failed.
* [BZ #5382]Ulrich Drepper2007-11-233-6/+55
| | | | | | | | | | * 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.
* * nscd/cache.c (prune_cache): If cache is empty, instruct callerUlrich Drepper2007-11-141-2/+5
| | | | to wake up in 24 hours.
* * nscd/gai.c (__ioctl): Define. Include check_native.c.Ulrich Drepper2007-11-141-0/+2
|
* * nscd/selinux.c (nscd_request_avc_has_perm): When compiled withUlrich Drepper2007-11-061-0/+8
| | | | | old headers, don't call avc_has_perm if we don't have the permission information.
* * time/tzfile.c (__tzfile_read): Fix check for version 0 data files.Ulrich Drepper2007-11-061-1/+1
| | | | Patch by Szymon Siwek <sls@poczta.wp.pl>.
* * nscd/aicache.c (addhstaiX): Check herrno after IPv4 lookup onlyUlrich Drepper2007-11-066-106/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * nscd/Makefile (nscd-modules): Replace gethstbynm2_r withUlrich Drepper2007-10-305-24/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gethstbynm3_r. * nscd/gethstbynm2_r.c: Remove. * nscd/gethstbynm3_r.c: New file. * nscd/aicache.c (addhstaiX): Use __gethostbyaddr2_r instead of __gethostbyaddr_r. * nscd/gethstbyad_r.c: Generate __gethostbyaddr2_r function. Define __gethostbyaddr_r compatibility wrapper. * nscd/hstcache.c (cache_addhst): Add ttl parameter. Use it when determining timeout of entry. (lookup): Take new parameter and pass it to __gethostbyname3_r and __gethostbyaddr2_r. (addhstbyX): Pass reference to variable for TTL to lookup and cache_addhst. * nss/Versions [glibc] (GLIBC_PRIVATE): Export __nss_passwd_lookup2, __nss_group_lookup2, __nss_hosts_lookup2, __nss_services_lookup2, and __nss_next2. Remove __nss_services_lookup. * nss/XXX-lookup.c: Name function now *_lookup2. Add new parameter. Add compat wrapper. * nss/getXXbyYY_r.c: Changes to call new *_lookup2 functions and __nss_next2. * nss/getXXent_r.c: Likewise. * nss/getnssent_r.c: Likewise. * nss/nsswitch.c (__nss_lookup): Add new parameter. If first function does not exist in module, try the optional second name. (__nss_next2): New function. (__nss_next): Now wrapper around __nss_next2. * nss/nsswitch.h: Adjust __nss_lookup prototype. Declare __nss_next2. Adjust definition of db_lookup_function type. * nss/service-lookup.c: Define NO_COMPAT. * include/netdb.h: Declare __gethostbyaddr2_r and __gethostbyname3_r. * inet/ether_hton.c: Use __nss_next2 instead of __nss_next. * inet/ether_ntoh.c: Likewise. * sunrpc/netname.c: Likewise. * sunrpc/publickey.c: Likewise. * inet/getnetgrent.c: Likewise. Adjust calls to __nss_lookup. * inet/gethstbyad_r.c (DB_LOOKUP_FCT): Change to __nss_hosts_lookup2. * inet/gethstbynm2_r.c (DB_LOOKUP_FCT): Likewise. * inet/gethstbynm_r.c (DB_LOOKUP_FCT): Likewise. * inet/gethstent_r.c (DB_LOOKUP_FCT): Likewise. * nscd/aicache.c (addhstaiX): Fix default TTL handling. * inet/getnetgrent.c (setup): Encrypt static pointer.
* (prune_cache): Move test for modified file outside of locking.Ulrich Drepper2007-10-261-16/+22
|
* * nscd/nscd_getgr_r.c (nscd_getgr_r): Store result of successfulUlrich Drepper2007-10-151-10/+8
| | | | read from nscd.
* * include/time.h: Declare __tzset_parse_tz and __tzset_compute.Ulrich Drepper2007-10-141-20/+20
| | | | | | | | | | | | | | | | | | | * time/tzset.c (tzset_internal): Break TZ string parsing out into __tzset_parse_tz and updating of daylight, timezone, tzname into update_vars. (__tz_compute): Renamed from tz_compute. Take additional parameters. (__tz_convert): Updating of tm_isdst, tm_zone, and tm_gmtoff now happens in __tz_compute. * time/tzfile.c (__tzfile_read): Also read TZ string. (find_transition): Fold into __tzfile_compute. (__tzfile_compute): For times beyond the last transition try to use the TZ string. * timezone/tst-timezone.c: Information in daylight and tzname does change for Asia/Tokyo timezone with more concrete information. Remove the test. * include/stdio.h: Add libc_hidden_proto for ftello. * libio/ftello.c: Add libc_hidden_def.
* [BZ #3195]Ulrich Drepper2007-10-136-11/+11
| | | | | | | | | * nscd/nscd_getai.c (__nscd_getai): Set errno to 0 in case we found no entry. * nscd/nscd_getgr.c (nscd_getgr_r): Likewise. * nscd/nscd_gethst_r.c (nscd_gethst_r): Likewise. * nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise. * nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise.
* * nscd/nscd_getgr_r.c (nscd_getgr_r): Optimize a bit: use simplerUlrich Drepper2007-10-131-43/+59
| | | | | read mechanism when there are no group members and avoid no-op read syscall in this case.
* [BZ #3242]Ulrich Drepper2007-10-131-35/+68
| | | | | | | | | 2007-10-13 Ulrich Drepper <drepper@redhat.com> [BZ #3242] * nscd/nscd_helper.c (wait_on_socket): Take timeout as parameter. (__readall): If reading failed due to EAGAIN error wait a bit and possibly try again. (__readvall): Likewise.
* [BZ #3924]Ulrich Drepper2007-10-072-6/+25
| | | | | | * 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.