diff --git a/Versions.def b/Versions.def index 45b2127914..33409f1143 100644 --- a/Versions.def +++ b/Versions.def @@ -20,7 +20,6 @@ libc { GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 - GLIBC_2.4 %ifdef USE_IN_LIBIO HURD_CTHREADS_0.3 %endif diff --git a/debug/Versions b/debug/Versions index fd97834171..07d6fbb830 100644 --- a/debug/Versions +++ b/debug/Versions @@ -18,10 +18,4 @@ libc { __printf_chk; __fprintf_chk; __vprintf_chk; __vfprintf_chk; __gets_chk; } - GLIBC_2.4 { - __fgets_chk; __fgets_unlocked_chk; - __read_chk; __pread_chk; __pread64_chk; - __readlink_chk; __getcwd_chk; __getwd_chk; - __recv_chk; __recvfrom_chk; - } } diff --git a/debug/fgets_chk.c b/debug/fgets_chk.c index 27fbede7f0..813d0dce64 100644 --- a/debug/fgets_chk.c +++ b/debug/fgets_chk.c @@ -30,6 +30,7 @@ #include #include +#if 0 char * __fgets_chk (buf, size, n, fp) char *buf; @@ -65,3 +66,4 @@ __fgets_chk (buf, size, n, fp) _IO_release_lock (fp); return result; } +#endif diff --git a/debug/fgets_u_chk.c b/debug/fgets_u_chk.c index 324d7e371b..50d4405533 100644 --- a/debug/fgets_u_chk.c +++ b/debug/fgets_u_chk.c @@ -30,6 +30,7 @@ #include #include +#if 0 char * __fgets_unlocked_chk (buf, size, n, fp) char *buf; @@ -63,3 +64,4 @@ __fgets_unlocked_chk (buf, size, n, fp) fp->_IO_file_flags |= old_error; return result; } +#endif diff --git a/debug/getcwd_chk.c b/debug/getcwd_chk.c index cb864c858e..8d33b77826 100644 --- a/debug/getcwd_chk.c +++ b/debug/getcwd_chk.c @@ -20,7 +20,7 @@ #include #include - +#if 0 char * __getcwd_chk (char *buf, size_t size, size_t buflen) { @@ -29,3 +29,4 @@ __getcwd_chk (char *buf, size_t size, size_t buflen) return __getcwd (buf, size); } +#endif diff --git a/debug/getwd_chk.c b/debug/getwd_chk.c index 898af28d3f..3a224d94a4 100644 --- a/debug/getwd_chk.c +++ b/debug/getwd_chk.c @@ -20,7 +20,7 @@ #include #include - +#if 0 char * __getwd_chk (char *buf, size_t buflen) { @@ -32,3 +32,4 @@ __getwd_chk (char *buf, size_t buflen) link_warning (getwd, "the `getwd' function is dangerous and should not be used.") +#endif diff --git a/debug/pread64_chk.c b/debug/pread64_chk.c index 93e5151ddc..d281ad54af 100644 --- a/debug/pread64_chk.c +++ b/debug/pread64_chk.c @@ -19,7 +19,7 @@ #include #include - +#if 0 ssize_t __pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen) { @@ -28,3 +28,4 @@ __pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen) return __pread64 (fd, buf, offset, nbytes); } +#endif diff --git a/debug/pread_chk.c b/debug/pread_chk.c index 24c13103dd..cf4f9f203c 100644 --- a/debug/pread_chk.c +++ b/debug/pread_chk.c @@ -19,7 +19,7 @@ #include #include - +#if 0 ssize_t __pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen) { @@ -28,3 +28,4 @@ __pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen) return __pread (fd, buf, offset, nbytes); } +#endif diff --git a/debug/read_chk.c b/debug/read_chk.c index da2bc945b7..0c36aaed4f 100644 --- a/debug/read_chk.c +++ b/debug/read_chk.c @@ -23,7 +23,7 @@ # include #endif - +#if 0 ssize_t __read_chk (int fd, void *buf, size_t nbytes, size_t buflen) { @@ -36,3 +36,4 @@ __read_chk (int fd, void *buf, size_t nbytes, size_t buflen) return __read (fd, buf, nbytes); #endif } +#endif diff --git a/debug/readlink_chk.c b/debug/readlink_chk.c index ac18ee2c29..8aabe0af25 100644 --- a/debug/readlink_chk.c +++ b/debug/readlink_chk.c @@ -23,7 +23,7 @@ # include #endif - +#if 0 ssize_t __readlink_chk (const char *path, void *buf, size_t len, size_t buflen) { @@ -36,3 +36,4 @@ __readlink_chk (const char *path, void *buf, size_t len, size_t buflen) return __readlink (path, buf, len); #endif } +#endif diff --git a/debug/recv_chk.c b/debug/recv_chk.c index 7a49d17234..f83bd3ed2f 100644 --- a/debug/recv_chk.c +++ b/debug/recv_chk.c @@ -19,7 +19,7 @@ #include #include - +#if 0 ssize_t __recv_chk (int fd, void *buf, size_t n, size_t buflen, int flags) { @@ -31,3 +31,4 @@ __recv_chk (int fd, void *buf, size_t n, size_t buflen, int flags) __chk_fail (); return nrecv; } +#endif diff --git a/debug/recvfrom_chk.c b/debug/recvfrom_chk.c index e1b1da7f6b..9403479c00 100644 --- a/debug/recvfrom_chk.c +++ b/debug/recvfrom_chk.c @@ -19,7 +19,7 @@ #include #include - +#if 0 ssize_t __recvfrom_chk (int fd, void *buf, size_t n, size_t buflen, int flags, __SOCKADDR_ARG addr, socklen_t *addr_len) @@ -33,3 +33,4 @@ __recvfrom_chk (int fd, void *buf, size_t n, size_t buflen, int flags, __chk_fail (); return nrecv; } +#endif diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 755b33d916..4550d72296 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 10 +%define glibcrelease 11 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define prelinkarches noarch %define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64 @@ -1272,6 +1272,16 @@ rm -f *.filelist* %endif %changelog +* Thu Mar 3 2005 Jakub Jelinek 2.3.4-11 +- update from CVS + - fix execvp (#149290) + - fix dlclose (#145810) + - clear padding in gconv-modules.cache (#146614, BZ#776) +- rebuilt with GCC4 +- changed __GLIBC_MINOR__ for now back to 3 +- back out the newly added GLIBC_2.4 *_chk routines, instead + do the checking in macros + * Sat Feb 12 2005 Jakub Jelinek 2.3.4-10 - hopefully fix interaction with prelink (#147655) diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h index e33cbb401a..6ab6841c53 100644 --- a/libio/bits/stdio2.h +++ b/libio/bits/stdio2.h @@ -88,13 +88,17 @@ extern char *__gets_chk (char *__str, size_t); ((__bos (__str) == (size_t) -1) \ ? gets (__str) : __gets_chk (__str, __bos (__str))) -extern char *__fgets_chk (char *s, size_t size, int n, FILE *stream); +extern void __chk_fail (void) __attribute__((noreturn)); #define fgets(__str, __n, __fp) \ - ((__bos (__str) == (size_t) -1) \ - ? fgets (__str, __n, __fp) : __fgets_chk (__str, __bos (__str), __n, __fp)) + (__extension__ \ + ({ size_t __n_val = (__n); \ + if (__bos (__str) != (size_t) -1 && __bos (__str) < __n_val) \ + __chk_fail (); \ + fgets (__str, __n_val, __fp); })) -extern char *__fgets_unlocked_chk (char *s, size_t size, int n, FILE *stream); #define fgets_unlocked(__str, __n, __fp) \ - ((__bos (__str) == (size_t) -1) \ - ? fgets_unlocked (__str, __n, __fp) \ - : __fgets_unlocked_chk (__str, __bos (__str), __n, __fp)) + (__extension__ \ + ({ size_t __n_val = (__n); \ + if (__bos (__str) != (size_t) -1 && __bos (__str) < __n_val) \ + __chk_fail (); \ + fgets_unlocked (__str, __n_val, __fp); })) diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h index 215063f07d..dab98af569 100644 --- a/posix/bits/unistd.h +++ b/posix/bits/unistd.h @@ -21,64 +21,44 @@ # error "Never include directly; use instead." #endif -extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, - size_t __buflen) __wur; +extern void __chk_fail (void) __attribute__((noreturn)); #define read(fd, buf, nbytes) \ - (__bos0 (buf) != (size_t) -1 \ - && (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \ - ? __read_chk (fd, buf, nbytes, __bos0 (buf)) \ - : read (fd, buf, nbytes)) + (__extension__ \ + ({ size_t __nbytes_val = (nbytes); \ + if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __nbytes_val) \ + __chk_fail (); \ + read (fd, buf, __nbytes_val); })) #ifdef __USE_UNIX98 -extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, - __off_t __offset, size_t __bufsize) __wur; -extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset, size_t __bufsize) __wur; -# ifndef __USE_FILE_OFFSET64 -# define pread(fd, buf, nbytes, offset) \ - (__bos0 (buf) != (size_t) -1 \ - && (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \ - ? __pread64_chk (fd, buf, nbytes, offset, __bos0 (buf)) \ - : pread (fd, buf, offset, nbytes)) -# else -# define pread(fd, buf, nbytes, offset) \ - (__bos0 (buf) != (size_t) -1 \ - && (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \ - ? __pread_chk (fd, buf, nbytes, offset, __bos0 (buf)) \ - : pread (fd, buf, offset, nbytes)) -# endif +# define pread(fd, buf, nbytes, offset) \ + (__extension__ \ + ({ size_t __nbytes_val = (nbytes); \ + if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __nbytes_val) \ + __chk_fail (); \ + pread (fd, buf, __nbytes_val, offset); })) # ifdef __USE_LARGEFILE64 # define pread64(fd, buf, nbytes, offset) \ - (__bos0 (buf) != (size_t) -1 \ - && (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \ - ? __pread64_chk (fd, buf, nbytes, offset, __bos0 (buf)) \ - : pread64 (fd, buf, offset, nbytes)) + (__extension__ \ + ({ size_t __nbytes_val = (nbytes); \ + if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __nbytes_val) \ + __chk_fail (); \ + pread64 (fd, buf, __nbytes_val, offset); })) # endif #endif #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K -extern int __readlink_chk (__const char *__restrict __path, - char *__restrict __buf, size_t __len, - size_t __buflen) - __THROW __nonnull ((1, 2)) __wur; # define readlink(path, buf, len) \ - (__bos (buf) != (size_t) -1 \ - && (!__builtin_constant_p (len) || (len) > __bos (buf)) \ - ? __readlink_chk (path, buf, len, __bos (buf)) \ - : readlink (path, buf, len)) + (__extension__ \ + ({ size_t __len_val = (len); \ + if (__bos (buf) != (size_t) -1 && __bos (buf) < __len_val) \ + __chk_fail (); \ + readlink (path, buf, __len_val); })) #endif -extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) - __THROW __wur; #define getcwd(buf, size) \ - (__bos (buf) != (size_t) -1 \ - && (!__builtin_constant_p (size) || (size) > __bos (buf)) \ - ? __getcwd_chk (buf, size, buflen) : getcwd (buf, size)) - -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED -extern char *__getwd_chk (char *__buf, size_t buflen) - __THROW __nonnull ((1)) __attribute_deprecated__ __wur; -#define getwd(buf) \ - (__bos (buf) != (size_t) -1 ? __getwd_chk (buf, buflen) : getwd (buf)) -#endif + (__extension__ \ + ({ size_t __size_val = (size); \ + if (__bos (buf) != (size_t) -1 && __bos (buf) < __size_val) \ + __chk_fail (); \ + getcwd (buf, __size_val); })) diff --git a/socket/bits/socket2.h b/socket/bits/socket2.h index 0ccb24ca31..6998dca20d 100644 --- a/socket/bits/socket2.h +++ b/socket/bits/socket2.h @@ -21,18 +21,17 @@ # error "Never include directly; use instead." #endif -extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, - int __flags); +extern void __chk_fail (void) __attribute__((noreturn)); #define recv(fd, buf, n, flags) \ - (__bos0 (buf) != (size_t) -1 \ - ? __recv_chk (fd, buf, n, __bos0 (buf), flags) \ - : recv (fd, buf, n, flags)) + (__extension__ \ + ({ size_t __n_val = (__n); \ + if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __n_val) \ + __chk_fail (); \ + recv (fd, buf, __n_val, flags); })) -extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n, - size_t __buflen, int __flags, - __SOCKADDR_ARG __addr, - socklen_t *__restrict __addr_len); #define recvfrom(fd, buf, n, flags, addr, addr_len) \ - (__bos0 (buf) != (size_t) -1 \ - ? __recvfrom_chk (fd, buf, n, __bos0 (buf), flags, addr, addr_len) \ - : recvfrom (fd, buf, n, flags, addr, addr_len)) + (__extension__ \ + ({ size_t __n_val = (__n); \ + if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __n_val) \ + __chk_fail (); \ + recvfrom (fd, buf, __n_val, flags, addr, addr_len); }))