From eb13b9a02d939ee7440472c5a5f86e55f3adbd54 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 12 Mar 1998 09:35:57 +0000 Subject: [PATCH] Update. 1998-03-12 Matthias Urlichs * nscd/nscd.c: Ignore SIGPIPE. 1998-03-12 Ulrich Drepper * nscd/nscd_getgr_r.c: Use __ protected names. * nscd/nscd_getpw_r.c: Likewise. 1998-03-12 Matthias Urlichs * nscd/nscd_getpw_r.c: Use pw_*_len values correctly. * nscd/nscd_getpw_r.c: Fix length calculation in result check, null bytes are not transmitted. 1998-03-12 00:40 Franz Sirl * powerpc/syscalls.list: Correct typo. * alpha/syscalls.list: Likewise. * mips/syscalls.list: Likewise. 1998-03-12 Ulrich Drepper * socket/sys/socket.h: Add prototype for __socket. --- ChangeLog | 25 +++++++++++++++++++++++++ nscd/nscd.c | 1 + nscd/nscd_getgr_r.c | 4 ++-- nscd/nscd_getpw_r.c | 22 +++++++++++----------- socket/sys/socket.h | 1 + sysdeps/unix/sysv/linux/alpha/syscalls.list | 2 +- sysdeps/unix/sysv/linux/mips/syscalls.list | 2 +- sysdeps/unix/sysv/linux/powerpc/syscalls.list | 2 +- 8 files changed, 43 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d549f8a..b2dd2c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +1998-03-12 Matthias Urlichs + + * nscd/nscd.c: Ignore SIGPIPE. + +1998-03-12 Ulrich Drepper + + * nscd/nscd_getgr_r.c: Use __ protected names. + * nscd/nscd_getpw_r.c: Likewise. + +1998-03-12 Matthias Urlichs + + * nscd/nscd_getpw_r.c: Use pw_*_len values correctly. + * nscd/nscd_getpw_r.c: Fix length calculation in result check, + null bytes are not transmitted. + +1998-03-12 00:40 Franz Sirl + + * powerpc/syscalls.list: Correct typo. + * alpha/syscalls.list: Likewise. + * mips/syscalls.list: Likewise. + +1998-03-12 Ulrich Drepper + + * socket/sys/socket.h: Add prototype for __socket. + 1998-03-11 15:27 Ulrich Drepper * elf/rtld.c: Update help message. diff --git a/nscd/nscd.c b/nscd/nscd.c index a53abc1..83a7b5b 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -117,6 +117,7 @@ main (int argc, char **argv) signal (SIGINT, termination_handler); signal (SIGQUIT, termination_handler); signal (SIGTERM, termination_handler); + signal (SIGPIPE, SIG_IGN); /* Check if we are already running. */ if (check_pid (_PATH_NSCDPID)) diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c index 71acc06..7db28c2 100644 --- a/nscd/nscd_getgr_r.c +++ b/nscd/nscd_getgr_r.c @@ -71,7 +71,7 @@ nscd_open_socket (void) int sock; int saved_errno = errno; - sock = socket (PF_UNIX, SOCK_STREAM, 0); + sock = __socket (PF_UNIX, SOCK_STREAM, 0); if (sock < 0) { __set_errno (saved_errno); @@ -80,7 +80,7 @@ nscd_open_socket (void) addr.sun_family = AF_UNIX; strcpy (addr.sun_path, _PATH_NSCDSOCKET); - if (connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) + if (__connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) { close (sock); __set_errno (saved_errno); diff --git a/nscd/nscd_getpw_r.c b/nscd/nscd_getpw_r.c index 4804a45..fd512ab 100644 --- a/nscd/nscd_getpw_r.c +++ b/nscd/nscd_getpw_r.c @@ -71,7 +71,7 @@ nscd_open_socket (void) int sock; int saved_errno = errno; - sock = socket (PF_UNIX, SOCK_STREAM, 0); + sock = __socket (PF_UNIX, SOCK_STREAM, 0); if (sock < 0) { __set_errno (saved_errno); @@ -80,7 +80,7 @@ nscd_open_socket (void) addr.sun_family = AF_UNIX; strcpy (addr.sun_path, _PATH_NSCDSOCKET); - if (connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) + if (__connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) { close (sock); __set_errno (saved_errno); @@ -142,9 +142,9 @@ __nscd_getpw_r (const char *key, request_type type, struct passwd *resultbuf, struct iovec vec[5]; char *p = buffer; - if (buflen < pw_resp.pw_name_len + 1 + pw_resp.pw_passwd_len + 1 - + pw_resp.pw_gecos_len + 1 + pw_resp.pw_dir_len + 1 - + pw_resp.pw_shell_len + 1) + if (buflen < (pw_resp.pw_name_len + 1 + pw_resp.pw_passwd_len + 1 + + pw_resp.pw_gecos_len + 1 + pw_resp.pw_dir_len + 1 + + pw_resp.pw_shell_len + 1)) { __set_errno (ERANGE); close (sock); @@ -173,14 +173,14 @@ __nscd_getpw_r (const char *key, request_type type, struct passwd *resultbuf, buflen -= (pw_resp.pw_dir_len + 1); /* get pw_pshell */ vec[4].iov_base = p; - vec[4].iov_len = pw_resp.pw_dir_len; - p += pw_resp.pw_dir_len + 1; - buflen -= (pw_resp.pw_dir_len + 1); + vec[4].iov_len = pw_resp.pw_shell_len; + p += pw_resp.pw_shell_len + 1; + buflen -= (pw_resp.pw_shell_len + 1); nbytes = readv (sock, vec, 5); - if (nbytes != pw_resp.pw_name_len + 1 + pw_resp.pw_passwd_len + 1 + - pw_resp.pw_gecos_len + 1 + pw_resp.pw_dir_len + 1 + - pw_resp.pw_shell_len + 1) + if (nbytes != (pw_resp.pw_name_len + pw_resp.pw_passwd_len + + pw_resp.pw_gecos_len + pw_resp.pw_dir_len + + pw_resp.pw_shell_len)) { close (sock); return 1; diff --git a/socket/sys/socket.h b/socket/sys/socket.h index c3b75b3..2358ab5 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -85,6 +85,7 @@ typedef union { __SOCKADDR_ALLTYPES /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ +extern int __socket __P ((int __domain, int __type, int __protocol)); extern int socket __P ((int __domain, int __type, int __protocol)); /* Create two new sockets, of type TYPE in domain DOMAIN and using diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index fb15ea9..8b593a0 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -55,7 +55,7 @@ socketpair - socketpair 4 __socketpair socketpair sysctl - _sysctl 6 sysctl getresuid - getresuid 3 getresuid -getresgid - getresgid 3 getresuid +getresgid - getresgid 3 getresgid # access pci space protected from machine checks: pciconfig_read EXTRA pciconfig_read 5 pciconfig_read diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index c00ee6b..b939200 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -35,7 +35,7 @@ socket - socket 3 __socket socket socketpair - socketpair 4 __socketpair socketpair getresuid - getresuid 3 getresuid -getresgid - getresgid 3 getresuid +getresgid - getresgid 3 getresgid # # There are defined locally because the caller is also defined in this dir. diff --git a/sysdeps/unix/sysv/linux/powerpc/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/syscalls.list index c5f7725..605762a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/syscalls.list @@ -3,4 +3,4 @@ s_llseek llseek _llseek 5 __sys_llseek getresuid - getresuid 3 getresuid -getresgid - getresgid 3 getresuid +getresgid - getresgid 3 getresgid -- 2.7.4