Commit Graph

257 Commits

Author SHA1 Message Date
Ulrich Drepper 06cdec09ed (nscd_getpw_r): Remove incorrectly C&Ped free call in code handling detection of GC runs. 2005-09-22 14:35:11 +00:00
Roland McGrath a8d131a717 * nscd/dbg_log.c (init_logfile): Use fopen64 rather than fopen. 2005-09-20 20:15:15 +00:00
Ulrich Drepper 4fb5ab741a * nscd/nscd.c (main): Use error while process isn't running in the
background, not dbg_log.
	* nscd/nscd_conf.c (nscd_parse_file): Likewise.
	Mark messages with _().  Unify testing for database name.

	* sysdeps/unix/sysv/linux/Versions: Export inotify_* syscalls.
2005-08-24 06:37:27 +00:00
Ulrich Drepper 2c210d1eb8 * nscd/connection.c (DEFAULT_DATASIZE_PER_BUCKET): Move to nscd.h.
(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-23 23:21:53 +00:00
Ulrich Drepper a757fda3e7 * nscd/cache.c (prune_cache): Add more debug output. Only for
debug level 3 and higher and very verbose.
2005-08-16 22:47:26 +00:00
Ulrich Drepper 80ea303760 * nscd/cache.c (prune_cache): Use stat64 not stat.
* nscd/connections.c (nscd_init): Likewise.
2005-08-16 18:10:03 +00:00
Ulrich Drepper 908c9e87c3 * nscd/connections.c (main_loop_epoll): Pass NULL as event
argument for epoll_ctl(EPOLL_CTL_DEL) calls.
2005-08-09 06:16:47 +00:00
Ulrich Drepper 4630012fef * nscd/nscd_stat.c (receive_print_stats): Really print values of
thread number, paranoia, and restart interval the server is using.
2005-08-09 05:46:16 +00:00
Ulrich Drepper cc46d02a45 (cache_add): Comment hash table and header to disk. 2005-08-08 20:58:35 +00:00
Ulrich Drepper f54a329a28 * nscd/mem.c (mempool_alloc): Use posix_fallocate instead of ftruncate.
* nscd/connections.c (nscd_init): Likewise.
2005-08-08 20:42:33 +00:00
Ulrich Drepper dc4bb1c2be * posix/bits/unistd.h (confstr, getgroups, ttyname_r, gethostname,
getdomainname): Add __NTH.
	* stdlib/bits/stdlib.h (ptsname_r, wctomb, mbstowcs, wcstombs):
	Likewise.
	(realpath): Likewise.  Use __const instead of const.  Add __restrict
	keywords.
	* socket/bits/socket2.h (recvfrom): Add __restrict keyword to __buf.
	* wcsmbs/bits/wchar2.h (wmemcpy, wmemmove, wmempcpy, wmemset,
	wcscpy, wcpcpy, wcsncpy, wcpncpy, wcscat, wcsncat, vswprintf, wcrtomb,
	mbsrtowcs, wcsrtombs, mbsnrtowcs, wcsnrtombs): Add __NTH.
	* string/bits/string3.h (__memset_ichk): Likewise.
	(__memcpy_ichk, __memmove_ichk, __mempcpy_ichk, __strcpy_ichk,
	__stpcpy_ichk, __strncpy_ichk, stpncpy, __strcat_ichk,
	__strncat_ichk): Likewise.  Use __const instead of const.
	(__stpncpy_chk): Use __const instead of const.
	(__stpncpy_alias): Use __REDIRECT_NTH instead of __REDIRECT.

2005-08-08  Ulrich Drepper  <drepper@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>

	* nscd/mem.c (BLOCK_ALIGN_LOG, BLOCK_ALIGN, BLOCK_ALIGN_M1): Move
	definitions to...
	* nscd/nscd.h (BLOCK_ALIGN_LOG, BLOCK_ALIGN, BLOCK_ALIGN_M1): ...here.
	* nscd/connections.c (usekey): New enum.
	(check_use, verify_persistent_db): New functions.
	(nscd_init): If persistent database is corrupted, unlink it and
	recreate rather than falling back to non-persistent database.
	Call verify_persistent_db.  Avoid overflows in total computation.

2005-08-08  Ulrich Drepper  <drepper@redhat.com>

	* iconvdata/utf-16.c (PREPARE_LOOP): Minor cleanups to make code
	better readable.  Avoid passing var to loop function, it's not
	necessary at all.
2005-08-08 19:04:11 +00:00
Roland McGrath 3bfd2d42c0 * nscd/Makefile ($(objpfx)nscd): Pass $(nscd-cflags) to $(LINK.o). 2005-07-22 05:35:27 +00:00
Ulrich Drepper 401a9ec9ca * configure.in: Check for -fstack-protector gcc option.
* config.make.in (have-ssp): Add template.
	* nscd/Makefile (nscd-cflags): Add -fstack-protector if supported.

	* nscd/nscd.c (main): Don't ignore result of chdir call.
2005-07-19 15:35:50 +00:00
Ulrich Drepper be686f1876 (main): Don't ignore result of chdir call. 2005-07-19 15:30:46 +00:00
Ulrich Drepper 233399bce2 * nscd/Makefile (nscd-cflags): Add _FORTIFY_SOURCE.
* nscd/connections.c: Fix a few wur warnings.
2005-07-18 22:28:46 +00:00
Ulrich Drepper 9f3731cf7f * nscd/grpcache.c (cache_addgr): Use correct maximum for group ID
length.  Patch by Ivan Gyurdiev <ivg2@cornell.edu>.

	* debug/confstr_chk.c: New file.
	* debug/getdomainname_chk.c: New file.
	* debug/getgroups_chk.c: New file.
	* debug/gethostname_chk.c: New file.
	* debug/getlogin_r_chk.c: New file.
	* debug/ttyname_r_chk.c: New file.
	* posix/bits/unistd.h: Add definitions for new debug versions.
	* debug/tst-chk1.c: Add tests for new functions.
	* debug/Versions: Export new functions.
	* debug/Makefile (routines): Add new files.

	* stdlib/bits/stdlib.h: Fix typo.

	* manual/Makefile (libc/index.html): Depend on dir-add.texi.
2005-07-18 21:07:28 +00:00
Ulrich Drepper f45729d8cd * nscd/nscd_helper.c: Add a few __builtin_expect. 2005-07-14 02:53:33 +00:00
Ulrich Drepper a08ab89700 * nscd/connections.c (send_ro_fd): Make sure BUF is aligned correctly. 2005-07-14 02:17:58 +00:00
Ulrich Drepper 7529e67ed8 * nscd/nscd_helper.c (wait_on_socket): New function.
(get_mapping): Use wait_on_socket instead of poll.  The former handles
	EINTR of poll correctly.
	(__nscd_open_socket): Likewise.
	(get_mapping): Make sure BUF is aligned correctly.
	(get_mapping): Use munmap on correct pointer.
2005-07-13 22:47:24 +00:00
Ulrich Drepper bb6e8ca30a * nscd/nscd_stat.c (receive_print_stats): Replace YESSTR/NOSTR
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.
2005-06-26 18:28:35 +00:00
Ulrich Drepper 64d64de628 * nscd/nscd.init: Get more in line with lsb3.
* nscd/nscd.c: Adjust some error codes to fit in better with lsb3.
	* nscd/connections.c: Likewise.
2005-06-20 15:49:08 +00:00
Ulrich Drepper ec23b9bece * configure.in: Add test for availability of libaudit.
* config.h.in: Define HAVE_LIBAUDIT.
	* config.make.in: Define have-libaudit.
	* nscd/Makefile: If libaudit is available, link nscd with it.
	* nscd/selinux.c: If HAVE_LIBAUDIT is defined, log using libaudit.
	Patch by Steve Grubb <sgrubb@redhat.com>.
2005-06-14 22:52:30 +00:00
Ulrich Drepper 9393da4659 Help losers who use --with-headers. 2005-04-29 02:07:46 +00:00
Ulrich Drepper 75596b98a1 * nscd/connections.c (nscd_run): Use time() value in prune_cache
call, not timeout value, since the latter might be from another clock.
2005-04-28 06:27:13 +00:00
Roland McGrath c9e169479e [BZ #253]
2005-04-14  Roland McGrath  <roland@redhat.com>
	* MakeTAGS ($P/$(domain).pot): Depend on distinfo file as well.
	(extract): Filter-out distinfo file name.

	[BZ #253]
	* MakeTAGS (text-srcs): Match %.bash.in files too.

	[BZ #253]
	* nscd/Makefile (all-nscd-modules): New variable, include selinux
	module regardless of configuration.
	(distribute): Use that instead of $(nscd-modules).
2005-04-15 06:33:21 +00:00
Roland McGrath 0e07fc00ca * nscd/aicache.c (addhstaiX): Tweak type to avoid warning. 2005-03-17 09:43:50 +00:00
Ulrich Drepper d2dc7d8473 * nscd/nscd-client.h: Include sys/uio.h.
(__readall, __readvall, writeall): New prototypes.
	* nscd/connections.c (writeall): New function.
	(handle_request): Use it.
	* nscd/aicache.c (addhstaiX): Likewise.
	* nscd/initgrcache.c (addinitgroupsX): Likewise.
	* nscd/hstcache.c (cache_addhst): Likewise.
	* nscd/grpcache.c (cache_addgr): Likewise.
	* nscd/pwdcache.c (cache_addpw): Likewise.
	* nscd/nscd_helper.c (__readall, __readvall): New functions.
	* nscd/nscd_getai.c (__nscd_getai): Use them.
	* nscd/nscd_getpw_r.c (__nscd_getpw_r): Likewise.
	* nscd/nscd_getgr_r.c (__nscd_getgr_r): Likewise.
	* nscd/nscd_gethst_r.c (__nscd_gethst_r): Likewise.
	* nscd/nscd_initgroups.c (__nscd_getgrouplist): Likewise.
2005-02-22 22:58:32 +00:00
Ulrich Drepper 804bb90a5a Include sys/uio.h. (__readall, __readvall, writeall): New prototypes. 2005-02-22 22:51:26 +00:00
Ulrich Drepper 4379b40341 * nscd/nscd_gethst_r.c (nscd_gethst_r): Set *h_errnop to
NETDB_INTERNAL if buffer is too small.

	* nscd/hstcache.c (INCR): Remove.
	(addhstbyX): Double buflen in each iteration rather than add INCR.
	* nscd/grpcache.c: Likewise.
	* nscd/pwdcache.c: Likewise.
2005-02-21 23:43:21 +00:00
Ulrich Drepper 6aa10807fc [BZ #677]
* nscd/nscd.c (termination_handler): Avoid segfault if some database
	is not enabled.

	* nscd/nscd_getai.c (__nscd_getai): If ai_resp->found == -1, set
	__nss_not_use_nscd_hosts and return -1.
	* nscd/nscd_initgroups.c (__nscd_getgrouplist): If
	initgr_resp->found == -1, set __nss_not_use_nscd_group and return -1.
	Avoid leaking sockets.

2005-01-28  Andreas Schwab  <schwab@suse.de>
	    H.J. Lu  <hongjiu.lu@intel.com>

	[BZ #677]
	* elf/dl-runtime.c (fixup): Change return type to
	DL_FIXUP_VALUE_TYPE. Use DL_FIXUP_VALUE_TYPE,
	DL_FIXUP_MAKE_VALUE and DL_FIXUP_VALUE_CODE_ADDR for relocation
	values. Use DL_FIXUP_VALUE_ADDR and DL_FIXUP_ADDR_VALUE to
	store and retrieve relocation values.
	(profile_fixup): Likewise.
	* include/link.h (link_map): Use DL_FIXUP_VALUE_TYPE for
	l_reloc_result.
	* sysdeps/generic/dl-fptr.h (link_map): Forward declaration.
	* sysdeps/generic/dl-lookupcfg.h (DL_FIXUP_VALUE_TYPE): New.
	(DL_FIXUP_MAKE_VALUE): Likewise.
	(DL_FIXUP_VALUE_CODE_ADDR): Likewise.
	(DL_FIXUP_VALUE_ADDR): Likewise.
	(DL_FIXUP_ADDR_VALUE): Likewise.
	* sysdeps/ia64/dl-lookupcfg.h: Include <dl-fptr.h> for "struct fdesc".
	(DL_FIXUP_VALUE_TYPE): New.
	(DL_FIXUP_MAKE_VALUE): Likewise.
	(DL_FIXUP_VALUE_CODE_ADDR): Likewise.
	(DL_FIXUP_VALUE_ADDR): Likewise.
	(DL_FIXUP_ADDR_VALUE): Likewise.
	* sysdeps/ia64/dl-machine.h (elf_machine_profile_fixup_plt): Removed.
	(elf_machine_profile_plt): Removed.
	(elf_machine_fixup_plt): Change return type and type of value
	parameter to struct fdesc.
	(elf_machine_plt_value): Likewise.
	(elf_machine_rela): Use DL_FIXUP_MAKE_VALUE to construct
	argument for elf_machine_fixup_plt.

2005-02-07  Jakub Jelinek  <jakub@redhat.com>
2005-02-07 22:56:07 +00:00
Roland McGrath 58954d492d * nscd/nscd.init (reload): Print Reloading nscd: before and a newline
after the status string printed by killproc.
2005-02-07 19:30:19 +00:00
Ulrich Drepper 6925ef9a67 Update.
2005-01-30  Ulrich Drepper  <drepper@redhat.com>

	* nscd/nscd_helper.c (get_mapping): Use MSG_NOSIGNAL if available.
	* nscd/connections.c (send_ro_fd): Likewise.
2005-01-30 20:34:21 +00:00
Roland McGrath 24e860324f 2005-01-17 Roland McGrath <roland@redhat.com>
* nscd/Makefile (LDLIBS-nscd): New variable.
	($(objpfx)nscd): Use that instead of selinux-LIBS.
2005-01-18 01:21:35 +00:00
Ulrich Drepper 1b85ed0ce2 * posix/getconf.c: Update copyright year.
* nss/getent.c: Likewise.
	* nscd/nscd_nischeck.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.
2005-01-12 23:43:44 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00
Roland McGrath fe81a1a00f 2004-12-16 Roland McGrath <roland@redhat.com>
* nscd/Makefile ($(objpfx)nscd): Don't depend on $(selinux-LIBS),
	which is usually a -lselinux that make will resolve wrongly.
2004-12-16 22:21:24 +00:00
Ulrich Drepper 8dd719970a (__nscd_getai): Avoid memory and file descriptor leaks. 2004-11-22 18:41:05 +00:00
Ulrich Drepper ed2ced8ae3 Update.
2004-11-10  Jakub Jelinek  <jakub@redhat.com>

	* Makefile (tests): Add tst-exit3.
	* tst-exit3.c: New test.
2004-11-10 07:54:40 +00:00
Ulrich Drepper 5429ff760a (libc_locked_map_ptr): Add new first parameter, used as class for definition.
* nscd/nscd-client.h (libc_locked_map_ptr): Add new first
	parameter, used as class for definition.
	* nscd/nscd_getpw_r.c: Adjust for libc_locked_map_ptr change.
	(pw_map_free): Ensure no crash after memory is freed.
	* nscd/nscd_getgr.c: Likewise.  Make map externally visible.
	* nscd/nscd_gethst.c: Likewise.
	* nscd/nscd_getai.c: Use map from nscd_gethost.c.
	* nscd/nscd_initgroups.c: Use map from nscd_getgr.c.
2004-11-10 07:50:03 +00:00
Ulrich Drepper 457962e5f1 Update.
2004-10-15  Ulrich Drepper  <drepper@redhat.com>

	* nscd/nscd.h (_PATH_NSCD_PASSWD_DB): Move to /var/db.
	(_PATH_NSCD_GROUP_DB): Likewise.
	(_PATH_NSCD_HOSTS_DB): Likewise.
	(_PATH_NSCD_XYZ_DB_TMP): New #define, point to /var/run.
	* nscd/connections.c (nscd_init): Non-persistent database files
	are created with the _PATH_NSCD_XYZ_DB_TMP path.
	* nscd/nscd.init: Create /var/db/nscd if necessary.
2004-10-15 21:20:11 +00:00
Ulrich Drepper a8a589676c (nscd_init): Non-persistent database files are created with the _PATH_NSCD_XYZ_DB_TMP path. 2004-10-15 21:12:15 +00:00
Ulrich Drepper 59350982d0 Update.
* nscd/Makefile: When using compilers without -fpie support, also
	link with -lselinux if necessary.
	Patch by Arkadiusz Miskiewicz <arekm@pld-linux.org>.
2004-10-14 20:55:58 +00:00
Ulrich Drepper 5ca3d19c74 Update.
2004-10-14  Ulrich Drepper  <drepper@redhat.com>

	* nscd/connections.c (nscd_init): Remove file if not persistent
	and not shared.  Patch by Jerome Borsboom <j.borsboom@erasmusmc.nl>.

	* sysdeps/unix/sysv/linux/i386/setresuid.c: Handle
	defined __NR_setresuid32 && !defined __NR_setresuid.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Handle
	defined __NR_setresgid32 && !defined __NR_setresgid.

	* sysdeps/sparc/fpu/bits/mathinline.h (__signbitf, __signbit,
	__signbitl, sqrtf, sqrt, sqrtl, fdim, fdimf): Use __NTH macro.

	* sysdeps/generic/errno-loc.c: Don't undef #errno
	if RTLD_PRIVATE_ERRNO.
	* include/errno.h (__errno_location): If RTLD_PRIVATE_ERRNO,
	add attribute_hidden.

	* dlfcn/dlinfo.c (dlinfo_doit): Replace iteration over GL(dl_loaded)
	chain with iteration over all namespaces' _ns_loaded chains.
	* sysdeps/powerpc/powerpc32/dl-machine.c (__elf_preferred_address):
	Likewise.
	* sysdeps/mips/dl-machine.h (elf_machine_runtime_link_map): Likewise.
2004-10-14 16:18:09 +00:00
Ulrich Drepper 695c43708f Update.
2004-10-05  Ulrich Drepper  <drepper@redhat.com>

	* grp/initgroups.c: Remove duplicate group IDs.
	* grp/compat-initgroups.c: Likewise.
	* nscd/initgrcache.c: Likewise.
2004-10-05 15:36:41 +00:00
Ulrich Drepper 6ab5f50de4 Update.
2004-10-05  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/x86_64/sysconf.c (__sysconf): Return 200112L
	for _SC_CPUTIME or _SC_THREAD_CPUTIME.

	* nscd/Makefile (nscd-cflags): Set to -DIS_IN_nscd=1, plus
	-fpie if building PIE.
	(CFLAGS-*.c): Use it.

	* nscd/Makefile (relro-LDFLAGS): Add -Wl,-z,now if have-z-relro.
	($(objpfx)nscd): Add $(relro-LDFLAGS).

	* sysdeps/unix/sysv/linux/i386/sysconf.c: Include hp-timing.h.
	(__sysconf): Return -1 for _SC_CPUTIME or _SC_THREAD_CPUTIME if
	!HP_TIMING_AVAIL.

2004-10-05  Ulrich Drepper  <drepper@redhat.com>

	* nscd/Makefile (distribute): Remove TODO.
	* nscd/TODO: Removed.
2004-10-05 09:26:23 +00:00
Ulrich Drepper e14bbf537e Update.
* nscd/gai.c: Define __no_netlink_support if NEED_NETLINK is
	defined and __ASSUME_NETLINK_SUPPORT is zero.
	* sysdeps/unix/sysv/linux/Makefile (CFLAGS-gai.c): Add
	-DNEED_NETLINK.
2004-10-04 23:30:29 +00:00
Ulrich Drepper e582c5eda2 Update.
2004-10-04  Ulrich Drepper  <drepper@redhat.com>

	* malloc/mtrace.pl: Avoid calling location unless it is needed for
	output.  Patch by Edward Bishop <binutils@gmail.com>.

	* nscd/Makefile (CFLAGS-gai.c): Add -fpie.
2004-10-04 23:22:47 +00:00
Ulrich Drepper 94d824f920 Update.
* sysdeps/unix/sysv/linux/ia64/sysconf.c: New file.
	* sysdeps/unix/sysv/linux/ia64/Dist: Add has_cpuclock.c.
	* sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c: Move actual
	testing code to...
	* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c: ...here.  New file.
	* sysdeps/unix/sysv/linux/i386/sysconf.c: Add dynamic check for
	_SC_CPUTIME and _SC_THREAD_CPUTIME.
2004-10-04 19:28:07 +00:00
Ulrich Drepper 3078cba2f7 Update.
* nscd/connections.c (start_threads): Use sysconf in case
	_POSIX_CLOCK_SELECTION or _POSIX_MONOTONIC_CLOCK is not greater zero.

	* nscd/nscd.c: Remove getaddrinfo stub definition.
2004-10-04 16:35:54 +00:00