Index: linux/libc/ChangeLog diff -u linux/libc/ChangeLog:1.198 linux/libc/ChangeLog:1.203 --- linux/libc/ChangeLog:1.198 Sun Feb 1 22:26:13 1998 +++ linux/libc/ChangeLog Sat Jun 20 15:21:57 1998 @@ -1,3 +1,130 @@ +Sat Jun 20 15:10:37 1998 H.J. Lu (hjl@gnu.org) + + * version 5.4.46 is released. + + * <_G_config.h>: change version to 5.4.46. + + * elf/libc/jump.params: set version to 5.4.46. + + * release.libc: update. + +Fri Jun 19 21:53:24 1998 H.J. Lu (hjl@gnu.org) + + * (SYS_syscall_lchown): Alias for SYS_lchown. + + * sysdeps/linux/chown.c: Return old chown, aka new lchown. + + * sysdeps/linux/__lchown.S: Removed. + + * sysdeps/linux/__syscall_lchown.S: New. + + * sysdeps/linux/Makefile (SRC2S): Rename __lchown.S to + __syscall_lchown.S. + +Fri Jun 19 20:30:06 1998 H.J. Lu (hjl@gnu.org) + + * rpc/svc_tcp.c (svctcp_recv): Back out the change on Sun Jun + 7 09:34:13 1998 by H.J. Lu (hjl@gnu.org). + * rpc/xdr_rec.c (set_input_fragment): Likewise. + +Fri Jun 19 01:31:02 1998 Pavel Kankovsky + + * nys/nsw/src/dns/dns_hosts.c (getanswer): Add safety bandage + for stupid programs trusting h_length. Add handling for CNAME + records in reverse zones. + + * locale/Makefile (localedef): Add -L../elfshared + (locale): Likewise. + +Tue Jun 16 08:33:30 1998 Wolfram Gloger + + * dl-malloc/malloc (malloc_extend_top): Fix a mixing + malloc()/free() and sbrk() bug. + +Thu Jun 11 12:14:52 1998 Greg Wolodkin + + * sysdeps/linux/i386/readdir_r.c: Fix a memory leak. + +Sun Jun 7 19:13:05 1998 H.J. Lu (hjl@gnu.org) + + * version 5.4.45 is released. + + * <_G_config.h>: change version to 5.4.45. + + * elf/libc/jump.params: set version to 5.4.45. + + * release.libc: update. + +Sun Jun 7 09:34:13 1998 H.J. Lu (hjl@gnu.org) + + * rpc/svc_tcp.c (svctcp_recv): Add FreeBSD DoS patch. + * rpc/xdr_rec.c (set_input_fragment): Likewise. + +Tue May 26 05:43:07 1998 Pavel Kankovsky + + * dl-malloc/malloc.c (MALLOC_TRIM_THRESHOLD_, MALLOC_TOP_PAD_, + MALLOC_MMAP_THRESHOLD_, MALLOC_MMAP_MAX_): Use + __libc_secure_getenv instead of getenv. + * locale/findlocale.c (LC_ALL, _nl_category_names[category], + LANG): Likewise. + * nls/msgcat.c (LANG, NLSPATH): Likewise. + * nys/nis/src/nis_names.c (NIS_GROUP, NIS_PATH): Likewise. + * time/bsdtime.c (TZ): Likewise. + + * nls/msgcat.c (catopen): Fix a security bug. + +Mon May 25 15:00:24 1998 Richard.Gooch@atnf.csiro.au + + * (SYS_lchown): Renamed from SYS_chown. + (SYS_rt_sigreturn, SYS_rt_sigaction, SYS_rt_sigprocmask, + SYS_rt_sigpending, SYS_rt_sigtimedwait, SYS_rt_sigqueueinfo, + SYS_rt_sigsuspend, SYS_pread, SYS_pwrite, SYS_chown, + SYS_syscall_chown): New. + + * (__chown): Removed: + (__lchown, lchown): New. + + * sysdeps/linux/Makefile (SRC1S): Add chown.c. + (SRC2S): Rename __chown.S to __syscall_chown.S and add + __lchown.S. + + * sysdeps/linux/__chown.S: Removed. + + * sysdeps/linux/__lchown.S: New. + + * sysdeps/linux/__syscall_chown.S: New. + + * sysdeps/linux/chown.c: New. + +Mon May 4 16:48:25 1998 H.J. Lu (hjl@gnu.org) + + * elf/Makefile (lib): Remove OLD_GCC. + +Mon May 4 08:02:12 1998 H.J. Lu (hjl@gnu.org) + + * inet/inet_addr.c (inet_addr): Use strtoul and check overflow. + +Wed Apr 22 21:02:32 1998 H.J. Lu (hjl@gnu.org) + + * gcc/libgcc2.c: Make all global symbols weak. + +Sat Apr 11 20:34:23 1998 Alan Modra + + * sysdeps/linux/i386/math/tanl.S: Fix a typo. + +Fri Mar 13 14:36:49 1998 Marty Leisner + + * : Fix return values. + +Sun Mar 8 12:46:42 1998 Dean Gaudet + + * sysdeps/linux/i386/gmon/gmon.c (_mcleanup): Add support + for GMON_OUT_PREFIX. + +Thu Feb 19 15:53:06 1998 Chris Clark + + * nls/genlib.c (getmsg): Fix the \ddd sequence. + Sun Feb 1 22:23:11 1998 H.J. Lu (hjl@gnu.org) * version 5.4.44 is released. Index: linux/libc/config.in diff -u linux/libc/config.in:1.40 linux/libc/config.in:1.42 --- linux/libc/config.in:1.40 Fri Aug 8 12:12:44 1997 +++ linux/libc/config.in Sat Jun 20 15:21:59 1998 @@ -16,5 +16,5 @@ TARGET_ARCH_x86=5 MALLOC=dl-malloc OLD_GCC=true -GCCVERSION=2.7.2.3 -GCC_ARCH_INC_DIR=/usr/lib/gcc-lib/i586-unknown-linux-gnulibc1/2.7.2.3/include +GCCVERSION=egcs-2.90.29 +GCC_ARCH_INC_DIR=/usr/lib/gcc-lib/i586-unknown-linux-gnulibc1/egcs-2.90.29/include Index: linux/libc/release.libc diff -u linux/libc/release.libc:1.64 linux/libc/release.libc:1.66 --- linux/libc/release.libc:1.64 Sun Feb 1 22:26:14 1998 +++ linux/libc/release.libc Sat Jun 20 15:22:00 1998 @@ -1,43 +1,26 @@ Hi, Gals and Guys, -I updated libio from glibc 2. libg++ 2.7.2.8 or above should be used -with this release. +The Linux C library 5 is phasing out. I am only maintaining it for +very serious bug fixes only. People who want new features and other +improvements should use the Linux C library 6, aka, the GNU C library +2. Please check the glibc 2 web site for details. -md5 support is added. +http://www.gnu.org/software/libc/libc.html -I have modified the NIS support in libc, which is not compatible -with the previous version, but is compatible with SunOS, Solaris, ... -except for those brain dead xxxBSD. Please make sure you have the -same ypclients as the one at where you get this C library. Otherwise -your NIS won't work with the modified NIS code in this libc. If you -use a different yp client other than those in my YP clients package, -you may need a patch. Please send me a note and I will fix it for -you as soon as possible. - -Binaries of locale and localedef are included in the binary release. - -I added the support for larger PATH_MAX in linux 2.1.x. The old binaries -should run fine with the new shared library compiled with the new -PATH_MAX in linux 2.1.x. Let me know if you find any problems. - -I added some libc 6.x/glibc 2.x compatibility codes for libc 5.4.14 -so that the old XFree86 binaries will run fine with the new XFree86 -shared librraries compiled with libc 6.x/glibc 2.x. - -If you use linux 2.1.x, you need libc 5.4.44 or above to compile libc -yourself. The pre-compiled libc should run fine under linux 2.1.x. -Also this library is compiled with -D_REENTRANT so that errno is MT -safe. +The main changes from libc 5.4.44 are: +1. Security fixes. +2. Malloc fix. + The shared libraries are now compiled with -g1 which can provide minimum information when core dump happens. You can strip -libc.so.5.4.44 if you want. +libc.so.5.4.46 if you want. -Due to the new, improved locale, the Linux C library 5.4.44 is binary +Due to the new, improved locale, the Linux C library 5.4.46 is binary compatible with libc 5.3.12 but not vice versa. The binaries -compiled/linked with libc.so.5.4.44 may not run with libc.so.5.3.12. +compiled/linked with libc.so.5.4.46 may not run with libc.so.5.3.12. You may need to regenerate locale files for the new locale in libc -5.4.44 if you use locales other tha C/POSIX which are the defaults. +5.4.46 if you use locales other tha C/POSIX which are the defaults. The locale sources are at @@ -46,7 +29,7 @@ There are many security bug fixes. Please consult ChangeLog for details. Please let me know if there are more security bugs remains. -This is the beta release of the Linux C library 5.4.44. Please read +This is the beta release of the Linux C library 5.4.46. Please read the ChangeLog for details regarding changes/bug fixes. DISTRIBUTION SITES: @@ -66,11 +49,11 @@ DISTRIBUTION FILES: -1. libc-5.4.44.bin.tar.gz +1. libc-5.4.46.bin.tar.gz REQUIRED. This package contains the header files for libc, shared and static ELF libraries libc and libm, and the static ELF library libbsd.a. -The header files in libc-5.4.44.bin.tar.gz are not complete. You need to +The header files in libc-5.4.46.bin.tar.gz are not complete. You need to install the kernel source tree for the system-dependent header files. The header files are in lib-x.y.z.bin.tar.gz and libc-x.y.z.tar.gz. You @@ -81,11 +64,11 @@ to extract the header files without the binaries files. A separate tar file for the header files may cause unnecessary confusion. -2. libc-5.4.44.tar.gz +2. libc-5.4.46.tar.gz Source tree for libc and header files. -3. libc-5.4.43-5.4.44.diff.gz +3. libc-5.4.45-5.4.46.diff.gz Context diffs against the source tree from the previous libc release. Please make sure the empty libc/regex/rx.h is deleted. @@ -124,7 +107,7 @@ Linux kernel source code 1.99.10. You can comment out pthreads in DIRS in libc/sysdeps/Makefile. * gcc-2.7.2 or above and binutils-2.7.0.3 or above. -* ld.so-1.9.5 or above. The latest version can be obtained from +* ld.so-1.9.9 or above. The latest version can be obtained from ftp://ftp.ods.com/pub/linux * libg++ 2.7.2.8 or above. This is only necessary for development using c++. @@ -156,7 +139,7 @@ rm -f /usr/include/wcstr.h /usr/include/mbstr.h rm -f /usr/include/ld_so_config.h /usr/include/localeinfo.h rm -rf /usr/include/netinet /usr/include/net /usr/include/pthread -gzip -dc libc-5.4.44.bin.tar.gz | tar xvf - +gzip -dc libc-5.4.46.bin.tar.gz | tar xvf - SOURCE INSTALLATION: @@ -222,4 +205,4 @@ H.J. hjl@gnu.org -02/02/98 +06/21/98 Index: linux/libc/dl-malloc/malloc.c diff -u linux/libc/dl-malloc/malloc.c:1.12 linux/libc/dl-malloc/malloc.c:1.14 --- linux/libc/dl-malloc/malloc.c:1.12 Sat Nov 1 18:03:11 1997 +++ linux/libc/dl-malloc/malloc.c Sat Jun 20 15:22:03 1998 @@ -257,7 +257,9 @@ #include /* needed for malloc_stats */ +extern char *__libc_secure_getenv(const char *); + /* Compile-time options */ @@ -2018,11 +2020,11 @@ /* Also keep size a multiple of MALLOC_ALIGNMENT */ old_top_size = (old_top_size - 3*SIZE_SZ) & ~MALLOC_ALIGN_MASK; + set_head_size(old_top, old_top_size); chunk_at_offset(old_top, old_top_size )->size = SIZE_SZ|PREV_INUSE; chunk_at_offset(old_top, old_top_size + SIZE_SZ)->size = SIZE_SZ|PREV_INUSE; - set_head_size(old_top, old_top_size); /* If possible, release the rest. */ if (old_top_size >= MINSIZE) fREe(chunk2mem(old_top)); @@ -3365,15 +3367,15 @@ if(__libc_malloc_initialized) return; __libc_malloc_initialized = 1; - if((s = getenv("MALLOC_TRIM_THRESHOLD_"))) + if((s = __libc_secure_getenv("MALLOC_TRIM_THRESHOLD_"))) mALLOPt(M_TRIM_THRESHOLD, atoi(s)); - if((s = getenv("MALLOC_TOP_PAD_"))) + if((s = __libc_secure_getenv("MALLOC_TOP_PAD_"))) mALLOPt(M_TOP_PAD, atoi(s)); - if((s = getenv("MALLOC_MMAP_THRESHOLD_"))) + if((s = __libc_secure_getenv("MALLOC_MMAP_THRESHOLD_"))) mALLOPt(M_MMAP_THRESHOLD, atoi(s)); - if((s = getenv("MALLOC_MMAP_MAX_"))) + if((s = __libc_secure_getenv("MALLOC_MMAP_MAX_"))) mALLOPt(M_MMAP_MAX, atoi(s)); - s = getenv("MALLOC_CHECK_"); + s = __libc_secure_getenv("MALLOC_CHECK_"); if(s) { if(s[0]) mALLOPt(M_CHECK_ACTION, (int)(s[0] - '0')); __malloc_check_init(); Index: linux/libc/elf/Makefile diff -u linux/libc/elf/Makefile:1.19 linux/libc/elf/Makefile:1.20 --- linux/libc/elf/Makefile:1.19 Sun Dec 14 13:41:08 1997 +++ linux/libc/elf/Makefile Mon May 4 16:49:23 1998 @@ -24,10 +24,8 @@ # $(MAKE) -C d-link lib; LIBGCC=$(ELF_SHARED_DIR)/libgcc.a -ifeq ($(OLD_GCC),true) lib:: $(MAKE) -C crt crt -endif lib:: for l in $(BUILD_ELFLIBS); do \ Index: linux/libc/elf/libc/jump.params diff -u linux/libc/elf/libc/jump.params:1.97 linux/libc/elf/libc/jump.params:1.99 --- linux/libc/elf/libc/jump.params:1.97 Sun Feb 1 22:26:16 1998 +++ linux/libc/elf/libc/jump.params Sat Jun 20 15:22:06 1998 @@ -1 +1 @@ -Version=5.4.44 +Version=5.4.46 Index: linux/libc/gcc/libgcc2.c diff -u linux/libc/gcc/libgcc2.c:1.3 linux/libc/gcc/libgcc2.c:1.4 --- linux/libc/gcc/libgcc2.c:1.3 Sun Sep 10 19:26:27 1995 +++ linux/libc/gcc/libgcc2.c Tue May 5 11:48:10 1998 @@ -402,6 +402,8 @@ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, }; +#pragma weak __udivmoddi4 + #if (defined (L_udivdi3) || defined (L_divdi3) || \ defined (L_umoddi3) || defined (L_moddi3)) static inline @@ -683,6 +685,8 @@ #endif #ifdef L_umoddi3 +#pragma weak __umoddi3 + UDItype __udivmoddi4 (); UDItype __umoddi3 (u, v) @@ -697,6 +701,8 @@ #endif #ifdef L_udivdi3 +#pragma weak __udivdi3 + UDItype __udivmoddi4 (); UDItype __udivdi3 (n, d) @@ -1141,6 +1147,8 @@ #ifdef L__gcc_bcmp +#pragma weak __gcc_bcmp + /* Like bcmp except the sign is meaningful. Reult is negative if S1 is less than S2, positive if S1 is greater, 0 if S1 and S2 are equal. */ @@ -1163,6 +1171,9 @@ #endif #ifdef L_varargs + +#pragma weak __builtin_saveregs + #ifdef __i860__ #if defined(__svr4__) || defined(__alliant__) asm (" .text"); @@ -1616,6 +1627,7 @@ typedef void (*vfp)(void); extern vfp __new_handler; extern void __default_new_handler (void); +#pragma weak __builtin_new void * __builtin_new (size_t sz) @@ -1642,6 +1654,7 @@ is used by C++ programs to allocate a block of memory for an array. */ extern void * __builtin_new (size_t); +#pragma weak __builtin_vec_new void * __builtin_vec_new (size_t sz) @@ -1670,8 +1683,12 @@ typedef void (*vfp)(void); void __default_new_handler (void); +#pragma weak __new_handler + vfp __new_handler = (vfp)0; +#pragma weak set_new_handler + vfp set_new_handler (vfp handler) { @@ -1685,6 +1702,8 @@ #define MESSAGE "Virtual memory exceeded in `new'\n" +#pragma weak __default_new_handler + void __default_new_handler () { @@ -1705,6 +1724,8 @@ by C++ programs to return to the free store a block of memory allocated as a single object. */ +#pragma weak __builtin_delete + void __builtin_delete (void *ptr) { @@ -1719,6 +1740,7 @@ allocated as an array. */ extern void __builtin_delete (void *); +#pragma weak __builtin_vec_delete void __builtin_vec_delete (void *ptr) @@ -1730,6 +1752,8 @@ /* End of C++ free-store management functions */ #ifdef L_shtab +#pragma weak __shtab + unsigned int __shtab[] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080, @@ -1747,6 +1771,8 @@ #define INSN_CACHE_PLANE_SIZE (INSN_CACHE_SIZE / INSN_CACHE_DEPTH) +#pragma weak __clear_cache + void __clear_cache (beg, end) char *beg, *end; @@ -2178,6 +2204,8 @@ */ +#pragma weak __find_first_exception_table_match + void * __find_first_exception_table_match(pc) void *pc; @@ -2235,6 +2263,8 @@ return (void*)0; } +#pragma weak __throw_type_match + void * __throw_type_match (void *catch_type, void *throw_type, void* obj) { @@ -2247,6 +2277,8 @@ return 0; } +#pragma weak __register_exceptions + void __register_exceptions (exception_table *table) { @@ -2276,7 +2308,10 @@ exception_table_list = node; } +#pragma weak __unwind_function + #if #machine(i386) + void __unwind_function(void *ptr) { @@ -2353,6 +2388,8 @@ #endif /* inhibit_libc */ #define MESSAGE "pure virtual method called\n" + +#pragma weak __pure_virtual void __pure_virtual () Index: linux/libc/inet/inet_addr.c diff -u linux/libc/inet/inet_addr.c:1.1.1.1 linux/libc/inet/inet_addr.c:1.2 --- linux/libc/inet/inet_addr.c:1.1.1.1 Fri Feb 17 21:33:20 1995 +++ linux/libc/inet/inet_addr.c Mon May 4 12:15:04 1998 @@ -36,6 +36,7 @@ #endif /* LIBC_SCCS and not lint */ #include "inetprivate.h" +#include /* * Internet address interpretation routine. @@ -66,37 +67,32 @@ { register u_long val; register int base, n; - register char c; u_int parts[4]; register u_int *pp = parts; + int saved_errno = errno; + errno = 0; for (;;) { /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, other=decimal. */ - val = 0; base = 10; if (*cp == '0') { if (*++cp == 'x' || *cp == 'X') base = 16, cp++; else base = 8; } - while ((c = *cp) != '\0') { - if (isascii(c) && isdigit(c)) { - val = (val * base) + (c - '0'); - cp++; - continue; - } - if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) + - (c + 10 - (islower(c) ? 'a' : 'A')); - cp++; - continue; - } - break; + else + base = 10; + val = strtoul (cp, (char **) &cp, base); + if (val == ULONG_MAX && errno == ERANGE) + { + errno = saved_errno; + return 0; } + if (*cp == '.') { /* * Internet format: @@ -105,11 +101,16 @@ * a.b (with b treated as 24 bits) */ if (pp >= parts + 3 || val > 0xff) + { + errno = saved_errno; return (0); + } *pp++ = val, cp++; } else break; } + errno = saved_errno; + /* * Check for trailing characters. */ Index: linux/libc/locale/Makefile diff -u linux/libc/locale/Makefile:1.12 linux/libc/locale/Makefile:1.13 --- linux/libc/locale/Makefile:1.12 Thu Jul 10 08:43:51 1997 +++ linux/libc/locale/Makefile Sat Jun 20 15:22:08 1998 @@ -48,10 +48,10 @@ programs: localedef locale localedef: $(LDEFSRCS:.c=.o) $(PROGLIBS:.c=.o) - $(CC) -o $@ $^ + $(CC) -o $@ $^ -L../elfshared locale: $(LOCSRCS:.c=.o) $(PROGLIBS:.c=.o) - $(CC) -o $@ $^ + $(CC) -o $@ $^ -L../elfshared programs/error.o: programs/error.c $(CC) $(CFLAGS) -c programs/error.c -o programs/error.o Index: linux/libc/locale/findlocale.c diff -u linux/libc/locale/findlocale.c:1.4 linux/libc/locale/findlocale.c:1.5 --- linux/libc/locale/findlocale.c:1.4 Fri Oct 4 15:53:01 1996 +++ linux/libc/locale/findlocale.c Sun Jun 7 19:16:07 1998 @@ -35,7 +35,9 @@ const struct locale_data *_nl_find_locale (const char *, size_t, int, char **); +extern char *__libc_secure_getenv(const char *); + static inline char * copy (const char *string) { @@ -73,11 +75,11 @@ { /* The user decides which locale to use by setting environment variables. */ - *name = getenv ("LC_ALL"); + *name = __libc_secure_getenv ("LC_ALL"); if (*name == NULL || (*name)[0] == '\0') - *name = getenv (_nl_category_names[category]); + *name = __libc_secure_getenv (_nl_category_names[category]); if (*name == NULL || (*name)[0] == '\0') - *name = getenv ("LANG"); + *name = __libc_secure_getenv ("LANG"); if (*name == NULL || (*name)[0] == '\0') *name = (char *) _nl_C_name; } Index: linux/libc/nls/genlib.c diff -u linux/libc/nls/genlib.c:1.1.1.1 linux/libc/nls/genlib.c:1.2 --- linux/libc/nls/genlib.c:1.1.1.1 Fri Feb 17 21:33:23 1995 +++ linux/libc/nls/genlib.c Mon May 4 12:15:06 1998 @@ -278,6 +278,7 @@ *tptr += (*cptr - '0'); ++cptr; } + tptr++; } else if (*cptr == quote) { *tptr++ = *cptr++; } else { Index: linux/libc/nls/msgcat.c diff -u linux/libc/nls/msgcat.c:1.8 linux/libc/nls/msgcat.c:1.9 --- linux/libc/nls/msgcat.c:1.8 Wed Aug 27 19:56:10 1997 +++ linux/libc/nls/msgcat.c Sun Jun 7 19:16:08 1998 @@ -1,5 +1,5 @@ #if 0 -static char rcsid[] = "@(#)$Id: msgcat.c,v 1.7 1997/03/15 04:03:04 hjl Exp $"; +static char rcsid[] = "@(#)$Id: msgcat.c,v 1.8 1997/08/28 02:56:10 hjl Exp $"; #endif /* -*- c++ -*- */ @@ -124,6 +124,8 @@ #include #endif +extern char *__libc_secure_getenv(const char *); + nl_catd catopen( const char *name, int type ) { @@ -141,13 +143,13 @@ if (stat(catpath, &sbuf)) return(NLERR); } else { #if BROKEN_SETLOCALE - if ((lang = (char *) getenv ("LANG")) == NULL) lang = "C"; + if ((lang = (char *) __libc_secure_getenv ("LANG")) == NULL) lang = "C"; #else /* Query the locale from the previous setlocale call in msgcat-libc.c*/ if ((lang = (char *) setlocale(LC_MESSAGES,(char *) NULL)) == NULL) lang="C"; #endif - if ((nlspath = (char *) getenv ("NLSPATH")) == NULL) { + if ((nlspath = (char *) __libc_secure_getenv ("NLSPATH")) == NULL) { #if OLD_NLS_PATHS nlspath = "/nlslib/%L/%N.cat:/nlslib/%N/%L"; #else @@ -187,6 +189,7 @@ ++nlspath; strcpy(pathP, lang); pathP = tmp; + continue; } else if (*(nlspath + 1) == 'N') { char * tmp = pathP + strlen(name); if (tmp > path + sizeof (path)) @@ -197,15 +200,14 @@ ++nlspath; strcpy(pathP, name); pathP = tmp; - } else *(pathP++) = *nlspath; - } else - { - if (pathP >= path + sizeof (path)) - { - goto error; + continue; } - *(pathP++) = *nlspath; } + if (pathP >= path + sizeof (path)) + { + goto error; + } + *(pathP++) = *nlspath; } *pathP = '\0'; if (stat(path, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) { Index: linux/libc/nys/nis/src/nis_names.c diff -u linux/libc/nys/nis/src/nis_names.c:1.3 linux/libc/nys/nis/src/nis_names.c:1.4 --- linux/libc/nys/nis/src/nis_names.c:1.3 Sun Oct 20 21:40:17 1996 +++ linux/libc/nys/nis/src/nis_names.c Sun Jun 7 19:16:10 1998 @@ -29,7 +29,9 @@ #include "nis_conf.h" #include "xalloc.h" +extern char *__libc_secure_getenv(const char *); + nis_name nis_local_directory(void) { static char *sbuf = NULL; @@ -152,7 +154,7 @@ static char default_group[NIS_MAXNAMELEN]; char *cptr; - if ((cptr=getenv("NIS_GROUP"))==NULL) + if ((cptr=__libc_secure_getenv("NIS_GROUP"))==NULL) return ""; if (strlen(cptr) >= sizeof(default_group)) @@ -317,7 +319,7 @@ return rnames; } - path = getenv("NIS_PATH"); + path = __libc_secure_getenv("NIS_PATH"); if (path == NULL) path = "$"; Index: linux/libc/nys/nsw/src/dns/dns_hosts.c diff -u linux/libc/nys/nsw/src/dns/dns_hosts.c:1.4 linux/libc/nys/nsw/src/dns/dns_hosts.c:1.5 --- linux/libc/nys/nsw/src/dns/dns_hosts.c:1.4 Wed May 31 22:12:30 1995 +++ linux/libc/nys/nsw/src/dns/dns_hosts.c Sat Jun 20 15:22:12 1998 @@ -146,6 +146,7 @@ int haveanswer, had_error; int toobig = 0; char tbuf[MAXDNAME+1]; + const char *tname = qname; host.h_name = NULL; eom = answer->buf + anslen; @@ -239,6 +240,25 @@ buflen -= n; continue; } + if (qtype == T_PTR && type == T_CNAME) { + n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); + if (n < 0) { + had_error++; + continue; + } + cp += n; + /* Get canonical name. */ + n = strlen(tbuf) + 1; /* for the \0 */ + if (n > buflen) { + had_error++; + continue; + } + strcpy(bp, tbuf); /* cannot overflow */ + tname = bp; + bp += n; + buflen -= n; + continue; + } if (type != qtype) { syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", @@ -249,7 +269,7 @@ } switch (type) { case T_PTR: - if (strcasecmp(qname, bp) != 0) { + if (strcasecmp(tname, bp) != 0) { syslog(LOG_NOTICE|LOG_AUTH, AskedForGot, qname, bp); cp += n; @@ -293,6 +313,14 @@ } } else { register int nn; + + if (class == C_IN && n != INT32SZ) { + cp += n; + syslog(LOG_NOTICE|LOG_AUTH, + "gethostby*.getanswer: got strange A record (size=%d) for \"%s\"\n", + n, host.h_name); + continue; + } host.h_length = n; host.h_addrtype = (class == C_IN) Index: linux/libc/sysdeps/linux/Makefile diff -u linux/libc/sysdeps/linux/Makefile:1.25 linux/libc/sysdeps/linux/Makefile:1.27 --- linux/libc/sysdeps/linux/Makefile:1.25 Sat Nov 1 18:03:16 1997 +++ linux/libc/sysdeps/linux/Makefile Sat Jun 20 15:22:19 1998 @@ -43,8 +43,8 @@ opendir.c rewinddir.c seekdir.c telldir.c morecore.c \ __getdirentries.c ttyname.c ttyname_r.c getcwd.c \ ftw.c glob.c sendmsg.c recvmsg.c readv.c writev.c scandir.c \ - sysctl.c kernel_version.c poll.c -SRC2S= __access.S __chdir.S __chmod.S __chown.S __close.S __dup.S \ + sysctl.c kernel_version.c poll.c chown.c +SRC2S= __access.S __chdir.S __chmod.S __syscall_chown.S __close.S __dup.S \ __dup2.S __execve.S __fchmod.S __fchdir.S __fchown.S __fcntl.S \ __fork.S __fstatfs.S __getegid.S __geteuid.S \ __getgid.S __getgrps.S __getitmr.S __getpid.S __getppid.S \ @@ -71,7 +71,7 @@ sched_getscheduler.S sched_yield.S sched_get_priority_max.S \ sched_get_priority_min.S sched_rr_get_interval.S fdatasync.S \ nanosleep.S __syscall_poll.S quotactl.S __nfsservctl.S \ - __setresgid.S __getresgid.S __prctl.S + __setresgid.S __getresgid.S __prctl.S __syscall_lchown.S SRC3S= fstatfs.c statfs.c uname.c __vfork.c vfork.c SRCS=$(SRC1S) $(SRC2S) $(SRC3S) Index: linux/libc/sysdeps/linux/__chown.S diff -u linux/libc/sysdeps/linux/__chown.S:1.1.1.1 linux/libc/sysdeps/linux/__chown.S:removed --- linux/libc/sysdeps/linux/__chown.S:1.1.1.1 Fri Feb 17 21:33:32 1995 +++ linux/libc/sysdeps/linux/__chown.S Sun Jul 19 08:37:55 1998 @@ -1,22 +0,0 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include - -SYSCALL__ (chown, 3) - ret Index: linux/libc/sysdeps/linux/__syscall_chown.S diff -u /dev/null linux/libc/sysdeps/linux/__syscall_chown.S:1.1 --- /dev/null Sun Jul 19 08:37:56 1998 +++ linux/libc/sysdeps/linux/__syscall_chown.S Sun Jun 7 19:16:19 1998 @@ -0,0 +1,22 @@ +/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include + +SYSCALL__ (syscall_chown, 3) + ret Index: linux/libc/sysdeps/linux/__syscall_lchown.S diff -u /dev/null linux/libc/sysdeps/linux/__syscall_lchown.S:1.1 --- /dev/null Sun Jul 19 08:37:57 1998 +++ linux/libc/sysdeps/linux/__syscall_lchown.S Sat Jun 20 15:22:22 1998 @@ -0,0 +1,22 @@ +/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include + +SYSCALL__ (syscall_lchown, 3) + ret Index: linux/libc/sysdeps/linux/chown.c diff -u /dev/null linux/libc/sysdeps/linux/chown.c:1.2 --- /dev/null Sun Jul 19 08:37:58 1998 +++ linux/libc/sysdeps/linux/chown.c Sat Jun 20 15:22:22 1998 @@ -0,0 +1,30 @@ +/* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include + +extern int __syscall_lchown __P ((const char *path, uid_t owner, gid_t group)); + +int chown (const char *path, uid_t owner, gid_t group) +{ + return __syscall_lchown (path, owner, group); +} Index: linux/libc/sysdeps/linux/i386/readdir_r.c diff -u linux/libc/sysdeps/linux/i386/readdir_r.c:1.3 linux/libc/sysdeps/linux/i386/readdir_r.c:1.4 --- linux/libc/sysdeps/linux/i386/readdir_r.c:1.3 Fri Oct 4 15:53:32 1996 +++ linux/libc/sysdeps/linux/i386/readdir_r.c Sat Jun 20 15:22:25 1998 @@ -130,7 +130,7 @@ /* We copy the dirent entry to entry. */ memcpy (entry, ((char *)dir->dd_buf) + dir->dd_nextloc, - sizeof(struct dirent)); + ((struct dirent *)(((char *)dir->dd_buf)+dir->dd_nextloc))->d_reclen); *ret = entry; /* Am I right? H.J. */ Index: linux/libc/sysdeps/linux/i386/gmon/gmon.c diff -u linux/libc/sysdeps/linux/i386/gmon/gmon.c:1.2 linux/libc/sysdeps/linux/i386/gmon/gmon.c:1.3 --- linux/libc/sysdeps/linux/i386/gmon/gmon.c:1.2 Fri Oct 4 15:53:32 1996 +++ linux/libc/sysdeps/linux/i386/gmon/gmon.c Mon May 4 12:15:10 1998 @@ -40,10 +40,8 @@ #include #include #include - -#ifdef DEBUG +#include #include -#endif #include "gmon.h" @@ -211,9 +209,18 @@ char *frompc; int toindex; struct rawarc rawarc; + char *env; moncontrol(0); - fd = creat( "gmon.out" , 0666 ); + if ((env = getenv("GMON_OUT_PREFIX"))) { + char fname[512]; + + snprintf(fname, sizeof(fname), "%s.%u", env, getpid()); + fd = creat(fname, 0666); + } + else { + fd = creat( "gmon.out" , 0666 ); + } if ( fd < 0 ) { perror( "mcount: gmon.out" ); return; Index: linux/libc/sysdeps/linux/i386/math/tanl.S diff -u linux/libc/sysdeps/linux/i386/math/tanl.S:1.1.1.1 linux/libc/sysdeps/linux/i386/math/tanl.S:1.2 --- linux/libc/sysdeps/linux/i386/math/tanl.S:1.1.1.1 Fri Feb 17 21:33:36 1995 +++ linux/libc/sysdeps/linux/i386/math/tanl.S Sun Jun 7 19:16:20 1998 @@ -38,7 +38,7 @@ fxch %st(1) fstp %st(0) L3: - fptanl + fptan fstsw %ax sahf jp L1 Index: linux/libc/time/bsdtime.c diff -u linux/libc/time/bsdtime.c:1.6 linux/libc/time/bsdtime.c:1.7 --- linux/libc/time/bsdtime.c:1.6 Sun Oct 20 21:40:22 1996 +++ linux/libc/time/bsdtime.c Sun Jun 7 19:16:22 1998 @@ -1015,6 +1015,8 @@ (void) tzparse(GMT, sp, TRUE); } +extern char *__libc_secure_getenv(const char *); + #ifdef __STDC__ void tzset(void) @@ -1026,7 +1028,7 @@ register const char * name; void tzsetwall(void); - name = getenv("TZ"); + name = __libc_secure_getenv("TZ"); if (name == NULL) { tzsetwall(); return; Index: linux/include/_G_config.h diff -u linux/include/_G_config.h:1.103 linux/include/_G_config.h:1.105 --- linux/include/_G_config.h:1.103 Sun Feb 1 22:26:24 1998 +++ linux/include/_G_config.h Sat Jun 20 15:22:27 1998 @@ -2,10 +2,10 @@ #ifndef _G_config_h #define _G_config_h -#define _LINUX_C_LIB_VERSION "5.4.44" +#define _LINUX_C_LIB_VERSION "5.4.46" #define _LINUX_C_LIB_VERSION_MAJOR 5 #define _LINUX_C_LIB_VERSION_MINOR 4 -#define _LINUX_C_LIB_VERSION_SUBMINOR 44 +#define _LINUX_C_LIB_VERSION_SUBMINOR 46 #define _G_LIB_VERSION "2.7.2" Index: linux/include/unistd.h diff -u linux/include/unistd.h:1.13 linux/include/unistd.h:1.14 --- linux/include/unistd.h:1.13 Wed May 29 01:39:51 1996 +++ linux/include/unistd.h Sun Jun 7 19:16:24 1998 @@ -183,10 +183,12 @@ /* Change the owner and group of FILE. */ -extern int __chown __P ((__const char *__file, - __uid_t __owner, __gid_t __group)); extern int chown __P ((__const char *__file, __uid_t __owner, __gid_t __group)); +extern int __lchown __P ((__const char *__file, + __uid_t __owner, __gid_t __group)); +extern int lchown __P ((__const char *__file, + __uid_t __owner, __gid_t __group)); #ifdef __USE_BSD /* Change the owner and group of the file that FD is open on. */ Index: linux/include/sys/syscall.h diff -u linux/include/sys/syscall.h:1.12 linux/include/sys/syscall.h:1.14 --- linux/include/sys/syscall.h:1.12 Sat Nov 1 18:03:19 1997 +++ linux/include/sys/syscall.h Sat Jun 20 15:22:30 1998 @@ -17,7 +17,7 @@ #define SYS_time 13 #define SYS_prev_mknod 14 #define SYS_chmod 15 -#define SYS_chown 16 +#define SYS_lchown 16 #define SYS_break 17 #define SYS_oldstat 18 #define SYS_lseek 19 @@ -178,5 +178,17 @@ #define SYS_setresgid 170 #define SYS_getresgid 171 #define SYS_prctl 172 +#define SYS_rt_sigreturn 173 +#define SYS_rt_sigaction 174 +#define SYS_rt_sigprocmask 175 +#define SYS_rt_sigpending 176 +#define SYS_rt_sigtimedwait 177 +#define SYS_rt_sigqueueinfo 178 +#define SYS_rt_sigsuspend 179 +#define SYS_pread 180 +#define SYS_pwrite 181 +#define SYS_chown 182 +#define SYS_syscall_chown SYS_chown +#define SYS_syscall_lchown SYS_lchown #endif /* */ Index: linux/include/sys/vm86.h diff -u linux/include/sys/vm86.h:1.3 linux/include/sys/vm86.h:1.4 --- linux/include/sys/vm86.h:1.3 Sun Jan 26 22:29:08 1997 +++ linux/include/sys/vm86.h Mon May 4 16:44:48 1998 @@ -8,8 +8,8 @@ __BEGIN_DECLS -extern vm86old __P ((struct vm86_struct * __info)); -extern vm86 __P ((unsigned long __subfunction, struct vm86plus_struct * __info)); +extern int vm86old __P ((struct vm86_struct * __info)); +extern int vm86 __P ((unsigned long __subfunction, struct vm86plus_struct * __info)); __END_DECLS