aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-05-29 10:21:16 +0000
committerUlrich Drepper <drepper@redhat.com>1998-05-29 10:21:16 +0000
commit66715f834cb1f2f5c3742e94f73bd630ea4b14eb (patch)
treeddf10eb9dab578cbe895b7bf351584d47f64a2fc
parentf962d792472c45c9bccdc6b0697ad3d6350e9270 (diff)
downloadglibc-66715f834cb1f2f5c3742e94f73bd630ea4b14eb.tar.xz
glibc-66715f834cb1f2f5c3742e94f73bd630ea4b14eb.zip
Update.
1998-05-28 00:53 Zack Weinberg <zack@rabi.phys.columbia.edu> * glibcbug.in: Send to bugs@gnu or libc-alpha@cygnus depending on whether this is a stable release or not (keeps snapshot bug reports out of the database). * include/libc-symbols.h: Use __ASSEMBLER__ test macro not ASSEMBLER. * sysdeps/arm/sysdep.h: Likewise. * sysdeps/i386/sysdep.h: Likewise. * sysdeps/m68k/sysdep.h: Likewise. * sysdeps/mach/mips/sysdep.h: Likewise. * sysdeps/mach/sys/reboot.h: Likewise. * sysdeps/mach/sysdep.h: Likewise. * sysdeps/unix/alpha/sysdep.h: Likewise. * sysdeps/unix/bsd/hp/m68k/sysdep.h: Likewise. * sysdeps/unix/bsd/osf/alpha/sysdep.h: Likewise. * sysdeps/unix/bsd/sequent/i386/sysdep.h: Likewise. * sysdeps/unix/bsd/sony/newsos/m68k/sysdep.h: Likewise. * sysdeps/unix/bsd/sun/m68k/sysdep.h: Likewise. * sysdeps/unix/bsd/vax/sysdep.h: Likewise. * sysdeps/unix/i386/sysdep.h: Likewise. * sysdeps/unix/mips/sysdep.h: Likewise. * sysdeps/unix/sparc/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h: Likewise. 1998-05-27 Mark Kettenis <kettenis@phys.uva.nl> * mach/Machrules: Use $(move-if-change). 1998-05-27 Mark Kettenis <kettenis@phys.uva.nl> * Makeconfig [elf=yes] (+interp): New variable, set to interp.os. * Makerules (lib%.so): Depend on $(+interp). (libc.so): Add interp.os to list of dependencies. (interp-obj): Remove variable. * mach/Machrules (+interp): Define to empty since libhurduser and libmachuser don't need to have the interpreter set. 1998-05-28 Andreas Jaeger <aj@arthur.rhein-neckar.de> * resolv/res_send.c: Security fixes from bind 4.9.7-REL. * resolv/gethnamaddr.c: Likewise. * resolv/res_comp.c: Likewise. 1998-05-28 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/wait4.c (__wait4): Use ANSI-style definition so that transparent union works.
-rw-r--r--ChangeLog58
-rw-r--r--Makeconfig1
-rw-r--r--Makerules11
-rw-r--r--glibcbug.in8
-rw-r--r--include/libc-symbols.h18
-rw-r--r--mach/Machrules7
-rw-r--r--resolv/gethnamaddr.c44
-rw-r--r--resolv/res_comp.c924
-rw-r--r--resolv/res_send.c42
-rw-r--r--sysdeps/arm/sysdep.h4
-rw-r--r--sysdeps/i386/sysdep.h4
-rw-r--r--sysdeps/m68k/sysdep.h4
-rw-r--r--sysdeps/mach/hurd/wait4.c9
-rw-r--r--sysdeps/mach/mips/sysdep.h2
-rw-r--r--sysdeps/mach/sys/reboot.h10
-rw-r--r--sysdeps/mach/sysdep.h4
-rw-r--r--sysdeps/unix/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/bsd/hp/m68k/sysdep.h4
-rw-r--r--sysdeps/unix/bsd/osf/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/bsd/sequent/i386/sysdep.h4
-rw-r--r--sysdeps/unix/bsd/sony/newsos/m68k/sysdep.h2
-rw-r--r--sysdeps/unix/bsd/sun/m68k/sysdep.h4
-rw-r--r--sysdeps/unix/bsd/vax/sysdep.h4
-rw-r--r--sysdeps/unix/i386/sysdep.h4
-rw-r--r--sysdeps/unix/mips/sysdep.h2
-rw-r--r--sysdeps/unix/sparc/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h4
34 files changed, 893 insertions, 319 deletions
diff --git a/ChangeLog b/ChangeLog
index 4489a8a414..66dc924e53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+1998-05-28 00:53 Zack Weinberg <zack@rabi.phys.columbia.edu>
+
+ * glibcbug.in: Send to bugs@gnu or libc-alpha@cygnus depending
+ on whether this is a stable release or not (keeps snapshot bug
+ reports out of the database).
+
+ * include/libc-symbols.h: Use __ASSEMBLER__ test macro not ASSEMBLER.
+ * sysdeps/arm/sysdep.h: Likewise.
+ * sysdeps/i386/sysdep.h: Likewise.
+ * sysdeps/m68k/sysdep.h: Likewise.
+ * sysdeps/mach/mips/sysdep.h: Likewise.
+ * sysdeps/mach/sys/reboot.h: Likewise.
+ * sysdeps/mach/sysdep.h: Likewise.
+ * sysdeps/unix/alpha/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/hp/m68k/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/osf/alpha/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/sequent/i386/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/sony/newsos/m68k/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/sun/m68k/sysdep.h: Likewise.
+ * sysdeps/unix/bsd/vax/sysdep.h: Likewise.
+ * sysdeps/unix/i386/sysdep.h: Likewise.
+ * sysdeps/unix/mips/sysdep.h: Likewise.
+ * sysdeps/unix/sparc/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h: Likewise.
+
+1998-05-27 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * mach/Machrules: Use $(move-if-change).
+
+1998-05-27 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * Makeconfig [elf=yes] (+interp): New variable, set to interp.os.
+ * Makerules (lib%.so): Depend on $(+interp).
+ (libc.so): Add interp.os to list of dependencies.
+ (interp-obj): Remove variable.
+ * mach/Machrules (+interp): Define to empty since libhurduser and
+ libmachuser don't need to have the interpreter set.
+
+1998-05-28 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * resolv/res_send.c: Security fixes from bind 4.9.7-REL.
+
+ * resolv/gethnamaddr.c: Likewise.
+
+ * resolv/res_comp.c: Likewise.
+
+1998-05-28 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * sysdeps/mach/hurd/wait4.c (__wait4): Use ANSI-style definition
+ so that transparent union works.
+
1998-05-29 08:58 Ulrich Drepper <drepper@cygnus.com>
* manual/texinfo.tex: Update to last available version.
diff --git a/Makeconfig b/Makeconfig
index ebe0723e80..3737e939dc 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -457,6 +457,7 @@ ifeq ($(elf),yes)
+postinit = $(addprefix $(csu-objpfx),crtn.o)
+prector = `$(CC) --print-file-name=crtbegin.o`
+postctor = `$(CC) --print-file-name=crtend.o`
++interp = $(addprefix $(elf-objpfx),interp.os)
endif
csu-objpfx = $(common-objpfx)csu/
elf-objpfx = $(common-objpfx)elf/
diff --git a/Makerules b/Makerules
index ece8f0610c..824a933284 100644
--- a/Makerules
+++ b/Makerules
@@ -335,15 +335,9 @@ endif
# build shared libraries in place from the installed *_pic.a files.
# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
# on other shared objects.
-lib%.so: lib%_pic.a $(+preinit) $(+postinit)
+lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp)
$(build-shlib)
-ifeq ($(elf),yes)
-interp-obj = $(common-objpfx)elf/interp.os
-$(common-objpfx)libc.so: $(interp-obj)
-$(patsubst %,$(objpfx)%.so,$(extra-libs)): $(interp-obj)
-endif
-
define build-shlib
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
-B$(csu-objpfx) $(load-map-file) \
@@ -390,7 +384,8 @@ $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
# Use our own special initializer and finalizer files for libc.so.
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
$(common-objpfx)libc_pic.os \
- $(elfobjdir)/sofini.os $(elfobjdir)/ld.so \
+ $(elfobjdir)/sofini.os \
+ $(elfobjdir)/interp.os $(elfobjdir)/ld.so \
$(..)libc.map
$(build-shlib)
common-generated += libc.so libc_pic.os
diff --git a/glibcbug.in b/glibcbug.in
index 11ac4b5ee3..0f392e7151 100644
--- a/glibcbug.in
+++ b/glibcbug.in
@@ -6,7 +6,7 @@
# these variables are filled in by configure
#
VERSION="@VERSION@"
-BUGGLIBC="bugs@gnu.org"
+RELEASE="@RELEASE@"
ADDONS="@subdirs@"
HOST="@host@"
CC='@CC@'
@@ -35,6 +35,12 @@ if test $? -ne 0; then
chmod 600 $TEMPx
fi
+if test "$RELEASE" = "stable"; then
+ BUGGLIBC="bugs@gnu.org"
+else
+ BUGGLIBC="libc-alpha@cygnus.com"
+fi
+
BUGADDR=${1-$BUGGLIBC}
: ${EDITOR=emacs}
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index dee8865ba3..4684cb7f4a 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -56,7 +56,7 @@
*/
-#ifndef ASSEMBLER
+#ifndef __ASSEMBLER__
/* Define the macros `_' and `N_' for conveniently marking translatable
strings in the libc source code. */
@@ -109,7 +109,7 @@ extern const char _libc_intl_domainname[];
# define strong_alias_asm(original, alias) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
.set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
-# ifdef ASSEMBLER
+# ifdef __ASSEMBLER__
# define strong_alias(original, alias) strong_alias_asm (original, alias)
# else
# define strong_alias(original, alias) \
@@ -120,7 +120,7 @@ extern const char _libc_intl_domainname[];
# define strong_alias_asm(original, alias) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
-# ifdef ASSEMBLER
+# ifdef __ASSEMBLER__
# define strong_alias(original, alias) strong_alias_asm (original, alias)
# else
# define strong_alias(original, alias) \
@@ -136,7 +136,7 @@ extern const char _libc_intl_domainname[];
#ifdef HAVE_WEAK_SYMBOLS
-# ifdef ASSEMBLER
+# ifdef __ASSEMBLER__
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
@@ -164,7 +164,7 @@ extern const char _libc_intl_domainname[];
# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
-# else /* ! ASSEMBLER */
+# else /* ! __ASSEMBLER__ */
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
# define weak_extern_asm(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
@@ -180,14 +180,14 @@ extern const char _libc_intl_domainname[];
# define weak_alias(o, a) weak_alias_asm (o, a)
# define weak_extern(symbol) weak_extern_asm (symbol)
-# endif /* ! ASSEMBLER */
+# endif /* ! __ASSEMBLER__ */
#else
# define weak_alias(original, alias) strong_alias(original, alias)
# define weak_extern(symbol) /* Do nothing; the ref will be strong. */
#endif
-#if (!defined ASSEMBLER && \
+#if (!defined __ASSEMBLER__ && \
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)))
/* GCC 2.7 and later has special syntax for weak symbols and aliases.
Using that is better when possible, because the compiler and assembler
@@ -207,7 +207,7 @@ extern const char _libc_intl_domainname[];
# define weak_const_function __attribute__ ((weak, __const__))
# endif /* HAVE_WEAK_SYMBOLS. */
-#endif /* Not ASSEMBLER, and GCC 2.7 or later. */
+#endif /* Not __ASSEMBLER__, and GCC 2.7 or later. */
#ifndef weak_function
@@ -326,7 +326,7 @@ extern const char _libc_intl_domainname[];
#endif /* Have GNU ld. */
#if DO_VERSIONING
-# ifdef ASSEMBLER
+# ifdef __ASSEMBLER__
# define symbol_version(real, name, version) \
.symver real, name##@##version
# define default_symbol_version(real, name, version) \
diff --git a/mach/Machrules b/mach/Machrules
index 8e48c367cd..b5ae381c05 100644
--- a/mach/Machrules
+++ b/mach/Machrules
@@ -114,7 +114,7 @@ $(patsubst %,$(objpfx)%.ustamp,$(user-interfaces)): $(objpfx)%.ustamp:
-server /dev/null -user /dev/null -header /dev/null
for call in $($*-calls); do \
$(transform-user-stub) \
- ../move-if-change $(objpfx)$(transform-user-stub-output)_$${call}.c \
+ $(move-if-change) $(objpfx)$(transform-user-stub-output)_$${call}.c \
$(objpfx)RPC_$${call}.c; \
done
touch $@
@@ -211,8 +211,9 @@ extra-libs += $(interface-library)
# Avoid -lmachuser requiring -lc, which may not be built yet. If the
# shared object is absent, ld may choose a static library someplace and
# produce a bogus libmachuser.so.
-+preinit =
-+postinit =
++preinit =
++postinit =
++interp =
interface.so = $(interface-library:lib%=%.so)
LDFLAGS-$(interface.so) = -nostdlib -nostartfiles
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index 4c8180fca8..3272dbd591 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -160,6 +160,24 @@ dprintf(msg, num)
# define dprintf(msg, num) /*nada*/
#endif
+#define BOUNDED_INCR(x) \
+ do { \
+ cp += x; \
+ if (cp > eom) { \
+ __set_h_errno (NO_RECOVERY); \
+ return (NULL); \
+ } \
+ } while (0)
+
+#define BOUNDS_CHECK(ptr, count) \
+ do { \
+ if ((ptr) + (count) > eom) { \
+ __set_h_errno (NO_RECOVERY); \
+ return (NULL); \
+ } \
+ } while (0)
+
+
static struct hostent *
getanswer(answer, anslen, qname, qtype)
const querybuf *answer;
@@ -170,7 +188,7 @@ getanswer(answer, anslen, qname, qtype)
register const HEADER *hp;
register const u_char *cp;
register int n;
- const u_char *eom;
+ const u_char *eom, *erdata;
char *bp, **ap, **hap;
int type, class, buflen, ancount, qdcount;
int haveanswer, had_error;
@@ -201,7 +219,8 @@ getanswer(answer, anslen, qname, qtype)
qdcount = ntohs(hp->qdcount);
bp = hostbuf;
buflen = sizeof hostbuf;
- cp = answer->buf + HFIXEDSZ;
+ cp = answer->buf;
+ BOUNDED_INCR(HFIXEDSZ);
if (qdcount != 1) {
__set_h_errno (NO_RECOVERY);
return (NULL);
@@ -211,7 +230,7 @@ getanswer(answer, anslen, qname, qtype)
__set_h_errno (NO_RECOVERY);
return (NULL);
}
- cp += n + QFIXEDSZ;
+ BOUNDED_INCR(n + QFIXEDSZ);
if (qtype == T_A || qtype == T_AAAA) {
/* res_send() has already verified that the query name is the
* same as the one we sent; this just gets the expanded name
@@ -243,12 +262,15 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n; /* name */
+ BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
type = _getshort(cp);
cp += INT16SZ; /* type */
class = _getshort(cp);
cp += INT16SZ + INT32SZ; /* class, TTL */
n = _getshort(cp);
cp += INT16SZ; /* len */
+ BOUNDS_CHECK(cp, n);
+ erdata = cp + n;
if (class != C_IN) {
/* XXX - debug? syslog? */
cp += n;
@@ -263,6 +285,10 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n;
+ if (cp != erdata) {
+ __set_h_errno (NO_RECOVERY);
+ return (NULL);
+ }
/* Store alias. */
*ap++ = bp;
n = strlen(bp) + 1; /* for the \0 */
@@ -291,6 +317,10 @@ getanswer(answer, anslen, qname, qtype)
continue;
}
cp += n;
+ if (cp != erdata) {
+ __set_h_errno (NO_RECOVERY);
+ return (NULL);
+ }
/* Get canonical name. */
n = strlen(tbuf) + 1; /* for the \0 */
if (n > buflen || n >= MAXHOSTNAMELEN) {
@@ -326,6 +356,10 @@ getanswer(answer, anslen, qname, qtype)
}
#if MULTI_PTRS_ARE_ALIASES
cp += n;
+ if (cp != erdata) {
+ __set_h_errno (NO_RECOVERY);
+ return (NULL);
+ }
if (!haveanswer)
host.h_name = bp;
else if (ap < &host_aliases[MAXALIASES-1])
@@ -397,6 +431,10 @@ getanswer(answer, anslen, qname, qtype)
bp += n;
buflen -= n;
cp += n;
+ if (cp != erdata) {
+ __set_h_errno (NO_RECOVERY);
+ return (NULL);
+ }
break;
default:
abort();
diff --git a/resolv/res_comp.c b/resolv/res_comp.c
index 94a6270b6e..2661963632 100644
--- a/resolv/res_comp.c
+++ b/resolv/res_comp.c
@@ -63,9 +63,10 @@ static char rcsid[] = "$Id$";
#include <netinet/in.h>
#include <arpa/nameser.h>
-#include <stdio.h>
-#include <resolv.h>
#include <ctype.h>
+#include <errno.h>
+#include <resolv.h>
+#include <stdio.h>
#if defined(BSD) && (BSD >= 199103)
# include <unistd.h>
@@ -74,8 +75,17 @@ static char rcsid[] = "$Id$";
# include "../conf/portability.h"
#endif
-static int dn_find __P((u_char *exp_dn, u_char *msg,
- u_char **dnptrs, u_char **lastdnptr));
+static int ns_name_ntop __P((const u_char *, char *, size_t));
+static int ns_name_pton __P((const char *, u_char *, size_t));
+static int ns_name_unpack __P((const u_char *, const u_char *,
+ const u_char *, u_char *, size_t));
+static int ns_name_pack __P((const u_char *, u_char *, int,
+ const u_char **, const u_char **));
+static int ns_name_uncompress __P((const u_char *, const u_char *,
+ const u_char *, char *, size_t));
+static int ns_name_compress __P((const char *, u_char *, size_t,
+ const u_char **, const u_char **));
+static int ns_name_skip __P((const u_char **, const u_char *));
/*
* Expand compressed domain name 'comp_dn' to full domain name.
@@ -85,261 +95,51 @@ static int dn_find __P((u_char *exp_dn, u_char *msg,
* Return size of compressed name or -1 if there was an error.
*/
int
-dn_expand(msg, eomorig, comp_dn, exp_dn, length)
- const u_char *msg, *eomorig, *comp_dn;
- char *exp_dn;
- int length;
+dn_expand(msg, eom, src, dst, dstsiz)
+ const u_char *msg;
+ const u_char *eom;
+ const u_char *src;
+ char *dst;
+ int dstsiz;
{
- register const u_char *cp;
- register char *dn;
- register int n, c;
- char *eom;