1998-10-19  Ulrich Drepper  <drepper@cygnus.com>

	* include/ldsodefs.h: New file.

	* iconv/gconv.c: Include ldsodefs.h, not elf/ldsodefs.h.
	Remove change to avoid using _CALL_DL_FCT.
	* iconv/gconv_db.c: Likewise.
	* iconv/gconv_dl.c: Likewise.
	* iconv/skeleton.c: Likewise, here for DL_CALL_FCT.
	* malloc/mtrace.c: Include ldsodefs.h, not elf/ldsodefs.h.
	* nss/nsswitch.c: Likewise.
	* nss/nsswitch.h: Likewise.

1998-10-19  Philip Blundell  <pb@nexus.co.uk>

	* sunrpc/Makefile (otherlibs): If static NSS is in use, set to the
	required libraries.
	* login/Makefile (otherlibs): Likewise.
	* nscd/Makefile (otherlibs): Likewise.
	* Makeconfig (link-libc) [! build_shared]: Add $(otherlibs).

	* debug/Makefile (install-bin): Only build catchsegv if using ELF.

	* inet/Makefile: Add -DSTATIC_NSS to CFLAGS.

1998-10-19  Philip Blundell  <pb@nexus.co.uk>

	* sysdeps/unix/sysv/linux/arm/syscalls.list: Added setfsgid
	and setfsuid.

1998-10-19  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* nscd/connections.c: Fix typos in comments and strings.

	* nscd/nscd.conf: Update according to recent changes to nscd.

	* nscd/cache.c (prune_cache): Remove wrong comment.

	copy_posix.mask for copy instruction.
This commit is contained in:
Ulrich Drepper 1998-10-19 15:22:14 +00:00
parent 816e6eb5a7
commit ce85d65bae
19 changed files with 101 additions and 60 deletions

View File

@ -1,3 +1,41 @@
1998-10-19 Ulrich Drepper <drepper@cygnus.com>
* include/ldsodefs.h: New file.
* iconv/gconv.c: Include ldsodefs.h, not elf/ldsodefs.h.
Remove change to avoid using _CALL_DL_FCT.
* iconv/gconv_db.c: Likewise.
* iconv/gconv_dl.c: Likewise.
* iconv/skeleton.c: Likewise, here for DL_CALL_FCT.
* malloc/mtrace.c: Include ldsodefs.h, not elf/ldsodefs.h.
* nss/nsswitch.c: Likewise.
* nss/nsswitch.h: Likewise.
1998-10-19 Philip Blundell <pb@nexus.co.uk>
* sunrpc/Makefile (otherlibs): If static NSS is in use, set to the
required libraries.
* login/Makefile (otherlibs): Likewise.
* nscd/Makefile (otherlibs): Likewise.
* Makeconfig (link-libc) [! build_shared]: Add $(otherlibs).
* debug/Makefile (install-bin): Only build catchsegv if using ELF.
* inet/Makefile: Add -DSTATIC_NSS to CFLAGS.
1998-10-19 Philip Blundell <pb@nexus.co.uk>
* sysdeps/unix/sysv/linux/arm/syscalls.list: Added setfsgid
and setfsuid.
1998-10-19 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* nscd/connections.c: Fix typos in comments and strings.
* nscd/nscd.conf: Update according to recent changes to nscd.
* nscd/cache.c (prune_cache): Remove wrong comment.
1998-10-19 13:24 Ulrich Drepper <drepper@cygnus.com> 1998-10-19 13:24 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/ld-collate.c (collate_startup): Clear bit for this * locale/programs/ld-collate.c (collate_startup): Clear bit for this
@ -14,7 +52,7 @@
(main): Before processing copy list add &copy_posix to copy_list. (main): Before processing copy list add &copy_posix to copy_list.
* locale/programs/locales.h: Add definition of copy_def_list_t. * locale/programs/locales.h: Add definition of copy_def_list_t.
* locale/programs/locfile.c: Clear bit for appropriate category in * locale/programs/locfile.c: Clear bit for appropriate category in
case of an copy instruction. copy_posix.mask for copy instruction.
1998-10-19 Ulrich Drepper <drepper@cygnus.com> 1998-10-19 Ulrich Drepper <drepper@cygnus.com>

View File

@ -417,7 +417,9 @@ $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf) elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
dbobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)db2) dbobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)db2)
else else
link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a
endif endif
endif endif

View File

@ -36,8 +36,12 @@ extra-libs-others = $(extra-libs)
libSegFault-routines = segfault libSegFault-routines = segfault
libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes)) libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes))
include ../Makeconfig
distribute += catchsegv.sh distribute += catchsegv.sh
ifeq ($(elf),yes)
install-bin = catchsegv install-bin = catchsegv
endif
generated = catchsegv generated = catchsegv
include ../Rules include ../Rules

View File

@ -23,9 +23,7 @@
#include <gconv.h> #include <gconv.h>
#include <sys/param.h> #include <sys/param.h>
#ifndef STATIC_GCONV #include <ldsodefs.h>
# include <elf/ldsodefs.h>
#endif
int int
internal_function internal_function
@ -43,12 +41,8 @@ __gconv (gconv_t cd, const char **inbuf, const char *inbufend, char **outbuf,
if (inbuf == NULL || *inbuf == NULL) if (inbuf == NULL || *inbuf == NULL)
/* We just flush. */ /* We just flush. */
#ifdef _CALL_DL_FCT
result = _CALL_DL_FCT (cd->steps->fct, result = _CALL_DL_FCT (cd->steps->fct,
(cd->steps, cd->data, NULL, NULL, converted, 1)); (cd->steps, cd->data, NULL, NULL, converted, 1));
#else
result = cd->steps->fct (cd->steps, cd->data, NULL, NULL, converted, 1);
#endif
else else
{ {
const char *last_start; const char *last_start;
@ -60,14 +54,9 @@ __gconv (gconv_t cd, const char **inbuf, const char *inbufend, char **outbuf,
do do
{ {
last_start = *inbuf; last_start = *inbuf;
#ifdef _CALL_DL_FCT
result = _CALL_DL_FCT (cd->steps->fct, result = _CALL_DL_FCT (cd->steps->fct,
(cd->steps, cd->data, inbuf, inbufend, (cd->steps, cd->data, inbuf, inbufend,
converted, 0)); converted, 0));
#else
result = cd->steps->fct (cd->steps, cd->data, inbuf, inbufend,
converted, 0);
#endif
} }
while (result == GCONV_EMPTY_INPUT && last_start != *inbuf while (result == GCONV_EMPTY_INPUT && last_start != *inbuf
&& *inbuf + cd->steps->min_needed_from <= inbufend); && *inbuf + cd->steps->min_needed_from <= inbufend);

View File

@ -23,10 +23,7 @@
#include <string.h> #include <string.h>
#include <bits/libc-lock.h> #include <bits/libc-lock.h>
#ifndef STATIC_GCONV #include <ldsodefs.h>
# include <elf/ldsodefs.h>
#endif
#include <gconv_int.h> #include <gconv_int.h>
@ -158,11 +155,7 @@ free_derivation (void *p)
for (cnt = 0; cnt < deriv->nsteps; ++cnt) for (cnt = 0; cnt < deriv->nsteps; ++cnt)
if (deriv->steps[cnt].end_fct) if (deriv->steps[cnt].end_fct)
#ifdef _CALL_DL_FCT
_CALL_DL_FCT (deriv->steps[cnt].end_fct, (&deriv->steps[cnt])); _CALL_DL_FCT (deriv->steps[cnt].end_fct, (&deriv->steps[cnt]));
#else
deriv->steps[cnt].end_fct (&deriv->steps[cnt]);
#endif
free ((struct gconv_step *) deriv->steps); free ((struct gconv_step *) deriv->steps);
free (deriv); free (deriv);
@ -228,11 +221,7 @@ gen_steps (struct derivation_step *best, const char *toset,
/* Call the init function. */ /* Call the init function. */
if (result[step_cnt].init_fct != NULL) if (result[step_cnt].init_fct != NULL)
#ifdef _CALL_DL_FCT
_CALL_DL_FCT (result[step_cnt].init_fct, (&result[step_cnt])); _CALL_DL_FCT (result[step_cnt].init_fct, (&result[step_cnt]));
#else
result[step_cnt].init_fct (&result[step_cnt]);
#endif
current = current->last; current = current->last;
} }
@ -243,11 +232,7 @@ gen_steps (struct derivation_step *best, const char *toset,
while (++step_cnt < *nsteps) while (++step_cnt < *nsteps)
{ {
if (result[step_cnt].end_fct != NULL) if (result[step_cnt].end_fct != NULL)
#ifdef _CALL_DL_FCT
_CALL_DL_FCT (result[step_cnt].end_fct, (&result[step_cnt])); _CALL_DL_FCT (result[step_cnt].end_fct, (&result[step_cnt]));
#else
result[step_cnt].end_fct (&result[step_cnt]);
#endif
#ifndef STATIC_GCONV #ifndef STATIC_GCONV
__gconv_release_shlib (result[step_cnt].shlib_handle); __gconv_release_shlib (result[step_cnt].shlib_handle);
#endif #endif

View File

@ -24,9 +24,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <bits/libc-lock.h> #include <bits/libc-lock.h>
#include <elf/ldsodefs.h>
#include <sys/param.h> #include <sys/param.h>
#include <ldsodefs.h>
#include <gconv_int.h> #include <gconv_int.h>

View File

@ -85,8 +85,8 @@
#ifndef STATIC_GCONV #ifndef STATIC_GCONV
# include <dlfcn.h> # include <dlfcn.h>
# include <elf/ldsodefs.h>
#endif #endif
#include <ldsodefs.h>
/* The direction objects. */ /* The direction objects. */
@ -222,15 +222,9 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
if (status == GCONV_OK) if (status == GCONV_OK)
#endif #endif
{ /* Give the modules below the same chance. */
/* Give the modules below the same chance. */ status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
#ifdef DL_CALL_FCT written, 1));
status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
written, 1));
#else
status = (*fct) (next_step, next_data, NULL, NULL, written, 1);
#endif
}
} }
} }
else else
@ -296,13 +290,8 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
const char *outerr = data->outbuf; const char *outerr = data->outbuf;
int result; int result;
#ifdef DL_CALL_FCT
result = DL_CALL_FCT (fct, (next_step, next_data, &outerr, result = DL_CALL_FCT (fct, (next_step, next_data, &outerr,
outbuf, written, 0)); outbuf, written, 0));
#else
result = (*fct) (next_step, next_data, &outerr, outbuf,
written, 0);
#endif
if (result != GCONV_EMPTY_INPUT) if (result != GCONV_EMPTY_INPUT)
{ {

15
include/ldsodefs.h Normal file
View File

@ -0,0 +1,15 @@
/* We must use the appropriate version for the system. */
#ifdef __ELF__
# include <elf/ldsodefs.h>
#else
/* We have no dynamic loading. Define the macros we need here as dummy
versions. */
# ifndef _LDSODEFS_H
# define _LDSODEFS_H 1
/* Call a function through a pointer. */
# define _CALL_DL_FCT(fctp, args) (*fctp) args
# define CALL_DL_FCT(fctp, args) (*fctp) args
# endif /* ldsodefs.h */
#endif

View File

@ -62,3 +62,7 @@ CFLAGS-gethstbynm_r.c = -DUSE_NSCD=1
CFLAGS-gethstbynm2_r.c = -DUSE_NSCD=1 CFLAGS-gethstbynm2_r.c = -DUSE_NSCD=1
endif endif
ifeq ($(build-static-nss),yes)
CFLAGS += -DSTATIC_NSS
endif

View File

@ -53,6 +53,11 @@ libutil-routines:= login login_tty logout logwtmp openpty forkpty
include ../Rules include ../Rules
ifeq (yes,$(build-static-nss))
otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a $(common-objpfx)libc.a
endif
# pt_chown needs to be setuid root. # pt_chown needs to be setuid root.
$(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force) $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force)
$(make-target-directory) $(make-target-directory)

View File

@ -28,9 +28,7 @@
#include <bits/libc-lock.h> #include <bits/libc-lock.h>
#endif #endif
#ifdef HAVE_ELF #include <ldsodefs.h>
#include <elf/ldsodefs.h>
#endif
#include <stdio.h> #include <stdio.h>

View File

@ -38,6 +38,11 @@ extra-objs := $(nscd-modules:=.o)
endif endif
ifeq (yes,$(build-static-nss))
otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a
endif
distribute := nscd.h nscd-client.h dbg_log.h \ distribute := nscd.h nscd-client.h dbg_log.h \
$(nscd-modules:=.c) TODO nscd.conf nscd.init \ $(nscd-modules:=.c) TODO nscd.conf nscd.init \
nscd_proto.h nscd_proto.h

View File

@ -118,9 +118,7 @@ cache_add (int type, void *key, size_t len, const void *packet, size_t total,
must be invalidated and remember them. Then we get the lock and must be invalidated and remember them. Then we get the lock and
actually remove them. This is complicated by the way we have to actually remove them. This is complicated by the way we have to
free the data structures since some hash table entries share the same free the data structures since some hash table entries share the same
data. data. */
This function must be called with the write-lock held. */
void void
prune_cache (struct database *table, time_t now) prune_cache (struct database *table, time_t now)
{ {

View File

@ -197,7 +197,7 @@ static void
handle_request (int fd, request_header *req, void *key) handle_request (int fd, request_header *req, void *key)
{ {
if (debug_level > 0) if (debug_level > 0)
dbg_log (_("handle_requests: request received (Version = %d)"), dbg_log (_("handle_request: request received (Version = %d)"),
req->version); req->version);
if (req->version != NSCD_VERSION) if (req->version != NSCD_VERSION)
@ -219,7 +219,7 @@ cannot handle old request version %d; current version is %d"),
/* Is this service enabled? */ /* Is this service enabled? */
if (!db->enabled) if (!db->enabled)
{ {
/* No sent the prepared record. */ /* No, sent the prepared record. */
if (TEMP_FAILURE_RETRY (write (fd, db->disabled_iov->iov_base, if (TEMP_FAILURE_RETRY (write (fd, db->disabled_iov->iov_base,
db->disabled_iov->iov_len)) db->disabled_iov->iov_len))
!= db->disabled_iov->iov_len) != db->disabled_iov->iov_len)
@ -372,7 +372,7 @@ nscd_run (void *p)
to 1kb. */ to 1kb. */
if (req.key_len < 0 || req.key_len > 1024) if (req.key_len < 0 || req.key_len > 1024)
{ {
dbg_log (_("key length in request to long: %Zd"), req.key_len); dbg_log (_("key length in request too long: %Zd"), req.key_len);
close (fd); close (fd);
continue; continue;
} }

View File

@ -7,6 +7,7 @@
# #
# logfile <file> # logfile <file>
# debug-level <level> # debug-level <level>
# threads <#threads to use>
# #
# enable-cache <service> <yes|no> # enable-cache <service> <yes|no>
# positive-time-to-live <service> <time in seconds> # positive-time-to-live <service> <time in seconds>
@ -14,11 +15,12 @@
# suggested-size <service> <prime number> # suggested-size <service> <prime number>
# check-files <service> <yes|no> # check-files <service> <yes|no>
# #
# Currently supported cache names (services): passwd, group # Currently supported cache names (services): passwd, group, hosts
# #
# logfile /var/adm/nscd.log # logfile /var/adm/nscd.log
# threads 6
debug-level 0 debug-level 0

View File

@ -26,7 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <elf/ldsodefs.h> /* We need some help from ld.so. */ #include <ldsodefs.h> /* We need some help from ld.so. */
#if !defined DO_STATIC_NSS || defined PIC #if !defined DO_STATIC_NSS || defined PIC
# include <gnu/lib-names.h> # include <gnu/lib-names.h>

View File

@ -26,7 +26,7 @@
#include <nss.h> #include <nss.h>
#include <resolv.h> #include <resolv.h>
#include <search.h> #include <search.h>
#include <elf/ldsodefs.h> #include <ldsodefs.h>
/* Actions performed after lookup finished. */ /* Actions performed after lookup finished. */

View File

@ -84,6 +84,11 @@ all: # Make this the default target; it will be defined in Rules.
include ../Makeconfig include ../Makeconfig
ifeq (yes,$(build-static-nss))
otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a
endif
ifeq (no,$(cross-compiling)) ifeq (no,$(cross-compiling))
# We can only build this library if we can run the rpcgen we build. # We can only build this library if we can run the rpcgen we build.
headers += $(rpcsvc:%.x=rpcsvc/%.h) headers += $(rpcsvc:%.x=rpcsvc/%.h)

View File

@ -2,10 +2,12 @@
s_getgroups getgroups getgroups 2 __syscall_getgroups s_getgroups getgroups getgroups 2 __syscall_getgroups
s_llseek llseek _llseek 5 __sys_llseek s_llseek llseek _llseek 5 __sys_llseek
s_setfsgid setfsgid setfsgid 1 __syscall_setfsgid
s_setfsuid setfsuid setfsuid 1 __syscall_setfsuid
s_setgid setgid setgid 1 __syscall_setgid s_setgid setgid setgid 1 __syscall_setgid
s_setgroups setgroups setgroups 2 __syscall_setgroups s_setgroups setgroups setgroups 2 __syscall_setgroups
s_setresuid setresuid setresuid 3 __syscall_setresuid
s_setresgid setresgid setresgid 3 __syscall_setresgid s_setresgid setresgid setresgid 3 __syscall_setresgid
s_setresuid setresuid setresuid 3 __syscall_setresuid
s_setuid setuid setuid 1 __syscall_setuid s_setuid setuid setuid 1 __syscall_setuid
vm86 - vm86 1 __vm86 vm86
syscall - syscall 5 syscall syscall - syscall 5 syscall
vm86 - vm86 1 __vm86 vm86