]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20061002T1858 cvs/fedora-2_5-base cvs/fedora-glibc-2_5-2
authorJakub Jelinek <jakub@redhat.com>
Mon, 2 Oct 2006 19:02:41 +0000 (19:02 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 2 Oct 2006 19:02:41 +0000 (19:02 +0000)
20 files changed:
ChangeLog
README
README.template
elf/rtld.c
fedora/branch.mk
fedora/glibc.spec.in
io/fts.c
libio/bug-wmemstream1.c
libio/tst-wmemstream1.c
libio/tst-wmemstream2.c
libio/wmemstream.c
localedata/ChangeLog
localedata/locales/en_GB
manual/message.texi
nscd/mem.c
nscd/nscd-client.h
nscd/nscd_helper.c
posix/glob.c
sysdeps/posix/getaddrinfo.c
sysdeps/unix/sysv/linux/sparc/sparc64/pause.c

index e7e5d7dc2d61ca3cec06d195ca02f66062d98076..7c213e12cd9ceb83baa195a7bfda4e38f7a860f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,51 @@
+2006-10-02  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #3291]
+       * sysdeps/unix/sysv/linux/sparc/sparc64/pause.c: Include
+       errno.h, signal.h, unistd.h and sysdep-cancel.h.
+       (__sigprocmask): Define.
+
+2006-10-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf/rtld.c (dl_main): Don't use prelinking if LD_DYNAMIC_WEAK is
+       used.
+
+2006-10-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * nscd/mem.c (mempool_alloc): Round array size to 16 bytes
+       in oldtotal and newtotal calculation.
+       * nscd/nscd-client.h (struct mapped_database): Add datasize
+       field.
+       * nscd/nscd_helper.c (get_mapping): Initialize datasize field.
+       (__nscd_get_map_ref): Get a new mapping even if mapping's data_size
+       increased.
+       (__nscd_cache_search): Add checks to make sure we never reference
+       data beyond the current mapping.
+
+2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * sysdeps/posix/getaddrinfo.c (match_prefix): Make mask and val
+       variables const to avoid compiler warnings.
+
+       * io/fts.c (fts_close): Remove redundant checks.
+       (fts_build): Likewise.
+       (fts_palloc): Likewise.
+
+       * manual/message.texi (Advanced gettext functions,
+       Using gettextized software): Fix typos.
+
+2006-09-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * posix/glob.c (glob_in_dir): Add some comments and asserts to
+       explain why there are no leaks.
+
 2006-09-29  Ulrich Drepper  <drepper@redhat.com>
 
+       * libio/wmemstream.c: Include <wchar.h>.
+       * libio/bug-wmemstream1.c: Likewise.
+       * libio/tst-wmemstream1.c: Likewise.
+       * libio/tst-wmemstream2.c: Likewise.
+
        * version.h (RELEASE): Bump to 2.5.
        * README: Regenerated.
 
diff --git a/README b/README
index 2b9495d0f9d0d7bfe4115320cd32e7c91e20489b..97b3a61e0640f56ce23d6d54cb126c987e813a74 100644 (file)
--- a/README
+++ b/README
@@ -10,13 +10,6 @@ In GNU/Linux systems, the C library works with the Linux kernel to
 implement the operating system behavior seen by user applications.
 In GNU/Hurd systems, it works with a microkernel and Hurd servers.
 
-Version 2.4 is the first release after a long period of development, and
-introduces changes to the API and a new ABI for all configurations.  It
-has been tested and deployed in new production systems, but should still
-be considered somewhat experimental.  The stable 2.3 release series
-continues to be maintained, and implements a widely-deployed ABI.
-Version 2.3.6 is available, and we will release 2.3.7 with more bug fixes.
-
 The GNU C Library implements much of the POSIX.1 functionality in the
 GNU/Hurd system, using configurations i[34567]86-*-gnu.
 
index 5e22a270b5d52bdab8afdb383afd9485b7a08d3a..02ef86c5941ddc15ef37c7463488b4658ccc155c 100644 (file)
@@ -10,13 +10,6 @@ In GNU/Linux systems, the C library works with the Linux kernel to
 implement the operating system behavior seen by user applications.
 In GNU/Hurd systems, it works with a microkernel and Hurd servers.
 
-Version 2.4 is the first release after a long period of development, and
-introduces changes to the API and a new ABI for all configurations.  It
-has been tested and deployed in new production systems, but should still
-be considered somewhat experimental.  The stable 2.3 release series
-continues to be maintained, and implements a widely-deployed ABI.
-Version 2.3.6 is available, and we will release 2.3.7 with more bug fixes.
-
 The GNU C Library implements much of the POSIX.1 functionality in the
 GNU/Hurd system, using configurations i[34567]86-*-gnu.
 
index 718fa13b71cd164724cb21a4677bd38ca0352ca8..7746377f37129bb441b2fde840a7520022e5a3b4 100644 (file)
@@ -2087,7 +2087,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
     }
 
   if (main_map->l_info[ADDRIDX (DT_GNU_LIBLIST)]
-      && ! __builtin_expect (GLRO(dl_profile) != NULL, 0))
+      && ! __builtin_expect (GLRO(dl_profile) != NULL, 0)
+      && ! __builtin_expect (GLRO(dl_dynamic_weak), 0))
     {
       ElfW(Lib) *liblist, *liblistend;
       struct link_map **r_list, **r_listend, *l;
index 67c94d153714746c93b169b5a78aacab0bdd47e6..5c112f20906e707906db9fe03349dc365e0df9cb 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-fc4
-fedora-sync-date := 2006-09-29 20:37 UTC
-fedora-sync-tag := fedora-glibc-20060929T2037
+fedora-sync-date := 2006-10-02 18:58 UTC
+fedora-sync-tag := fedora-glibc-20061002T1858
index b7ef376ca2128375849d67bc812ee461eb492b7f..37cda6065d3dd8885826bcd0c6193ee36fcb8c82 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 1
+%define glibcrelease 2
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define xenarches i686 athlon
 %ifarch %{xenarches}
@@ -1528,6 +1528,10 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Mon Oct  2 2006 Jakub Jelinek <jakub@redhat.com> 2.5-2
+- fix nscd database growing (#207928)
+- bypass prelinking when LD_DYNAMIC_WEAK=1 is in the environment
+
 * Fri Sep 29 2006 Jakub Jelinek <jakub@redhat.com> 2.5-1
 - glibc 2.5 release
 
index 6383fe8f179d806d1431eb4322d262c0816e1d29..532743fb3e011145b0f30f9d81acf316f6008e3a 100644 (file)
--- a/io/fts.c
+++ b/io/fts.c
@@ -251,8 +251,7 @@ fts_close(sp)
        /* Free up child linked list, sort array, path buffer. */
        if (sp->fts_child)
                fts_lfree(sp->fts_child);
-       if (sp->fts_array)
-               free(sp->fts_array);
+       free(sp->fts_array);
        free(sp->fts_path);
 
        /* Return to original directory, save errno if necessary. */
@@ -705,8 +704,7 @@ fts_build(sp, type)
                                 * structures already allocated.
                                 */
 mem1:                          saved_errno = errno;
-                               if (p)
-                                       free(p);
+                               free(p);
                                fts_lfree(head);
                                (void)__closedir(dirp);
                                cur->fts_info = FTS_ERR;
@@ -1043,10 +1041,7 @@ fts_palloc(sp, more)
         * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
         */
        if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
-               if (sp->fts_path) {
-                       free(sp->fts_path);
-                       sp->fts_path = NULL;
-               }
+               free(sp->fts_path);
                sp->fts_path = NULL;
                __set_errno (ENAMETOOLONG);
                return (1);
index 2190593c9332997b16cbabc7a4f5914820ca9969..22d67f71e93f481a743377e8425480bb8eca6721 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <string.h>
+#include <wchar.h>
 
 
 static int
index 0c59c1adcba837e4b0b9f6658d4a07a22bdff8c2..f8b308bc6cc8d6305d785a9a3ede42b73fdce158 100644 (file)
@@ -1,3 +1,5 @@
+#include <wchar.h>
+
 #define CHAR_T wchar_t
 #define W(o) L##o
 #define OPEN_MEMSTREAM open_wmemstream
index f51a1db20c0317b445c24f364453ffae3a4eeb57..e2442ebfac74a4d609ff002eb89fed57c58dd017 100644 (file)
@@ -1,3 +1,5 @@
+#include <wchar.h>
+
 #define CHAR_T wchar_t
 #define W(o) L##o
 #define OPEN_MEMSTREAM open_wmemstream
index 85ea64991a8453ce1ee19535ae239a2a0fb6f822..577931888debd437a6d1da6c3b0fef6d740b4bb9 100644 (file)
@@ -20,6 +20,7 @@
 #include "strfile.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <wchar.h>
 
 
 struct _IO_FILE_wmemstream
index aea3f35551d4bca29b57c14733a854dc3f4229c9..78414d58e75872b6aca247b2342fd502a16df6e3 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-01  Ulrich Drepper  <drepper@redhat.com>
+
+       * locales/en_GB: Use more complete en_US data in LC_NAME.
+
 2006-09-29  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #39]
index fdd2f49511fc93e100b46dccb3e341805b6c66b6..a42fb6a8d904f16c4e576b004548ec3ca8997c4b 100644 (file)
@@ -146,8 +146,7 @@ measurement    1
 END LC_MEASUREMENT
 
 LC_NAME
-name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
-<U0025><U006D><U0025><U0074><U0025><U0066>"
+copy "en_US"
 END LC_NAME
 
 LC_ADDRESS
index eab98e93389a6ae69b16739be83bfdae9540f505..1507a6d04afa0c4da959e5d51e9742a9c8b91a36 100644 (file)
@@ -1189,7 +1189,7 @@ the rules of how to select the plural form.  Since the formula varies
 with every language this is the only viable solution except for
 hardcoding the information in the code (which still would require the
 possibility of extensions to not prevent the use of new languages).  The
-details are explained in the GNU @code{gettext} manual.  Here only a a
+details are explained in the GNU @code{gettext} manual.  Here only a
 bit of information is provided.
 
 The information about the plural form selection has to be stored in the
@@ -1590,7 +1590,7 @@ the user to select the message s/he wants to see.  S/He must understand
 them.
 
 The POSIX locale model uses the environment variables @code{LC_COLLATE},
-@code{LC_CTYPE}, @code{LC_MESSAGES}, @code{LC_MONETARY}, @code{NUMERIC},
+@code{LC_CTYPE}, @code{LC_MESSAGES}, @code{LC_MONETARY}, @code{LC_NUMERIC},
 and @code{LC_TIME} to select the locale which is to be used.  This way
 the user can influence lots of functions.  As we mentioned above the
 @code{gettext} functions also take advantage of this.
index a41c0bdb074b8d97c491b7b106744167cb03604c..5206c5af38b9dd6d1da8f894f5f86badd0dd48f2 100644 (file)
@@ -1,5 +1,5 @@
 /* Cache memory handling.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
 
@@ -480,12 +480,12 @@ mempool_alloc (struct database_dyn *db, size_t len)
        {
          /* Try to resize the database.  Grow size of 1/8th.  */
          size_t oldtotal = (sizeof (struct database_pers_head)
-                            + db->head->module * sizeof (ref_t)
+                            + roundup (db->head->module * sizeof (ref_t), ALIGN)
                             + db->head->data_size);
          size_t new_data_size = (db->head->data_size
                                  + MAX (2 * len, db->head->data_size / 8));
          size_t newtotal = (sizeof (struct database_pers_head)
-                            + db->head->module * sizeof (ref_t)
+                            + roundup (db->head->module * sizeof (ref_t), ALIGN)
                             + new_data_size);
          if (newtotal > db->max_db_size)
            {
index 440697f1becec3b1089ece145d20e4281d2fe694..0fd2d9f547e3ed0babb1a6b2d92d1a87bd8a9b85 100644 (file)
@@ -258,6 +258,7 @@ struct mapped_database
   const char *data;
   size_t mapsize;
   int counter;         /* > 0 indicates it is usable.  */
+  size_t datasize;
 };
 #define NO_MAPPING ((struct mapped_database *) -1l)
 
index 1dfe746d7a2d0b0d2272e405ea98786f021e3117..7c45981586696f0f3f467bc2a9f4c26b0b945b3e 100644 (file)
@@ -290,6 +290,7 @@ get_mapping (request_type type, const char *key,
       newp->data = ((char *) mapping + head.header_size
                    + roundup (head.module * sizeof (ref_t), ALIGN));
       newp->mapsize = size;
+      newp->datasize = head.data_size;
       /* Set counter to 1 to show it is usable.  */
       newp->counter = 1;
 
@@ -340,7 +341,8 @@ __nscd_get_map_ref (request_type type, const char *name,
       /* If not mapped or timestamp not updated, request new map.  */
       if (cur == NULL
          || (cur->head->nscd_certainly_running == 0
-             && cur->head->timestamp + MAPPING_TIMEOUT < time (NULL)))
+             && cur->head->timestamp + MAPPING_TIMEOUT < time (NULL))
+         || cur->head->data_size > cur->datasize)
        cur = get_mapping (type, name,
                           (struct mapped_database **) &mapptr->mapped);
 
@@ -365,14 +367,18 @@ __nscd_cache_search (request_type type, const char *key, size_t keylen,
                     const struct mapped_database *mapped)
 {
   unsigned long int hash = __nis_hash (key, keylen) % mapped->head->module;
+  size_t datasize = mapped->datasize;
 
   ref_t work = mapped->head->array[hash];
-  while (work != ENDREF)
+  while (work != ENDREF && work + sizeof (struct hashentry) <= datasize)
     {
       struct hashentry *here = (struct hashentry *) (mapped->data + work);
 
-      if (type == here->type && keylen == here->len
-         && memcmp (key, mapped->data + here->key, keylen) == 0)
+      if (type == here->type
+         && keylen == here->len
+         && here->key + here->len <= datasize
+         && memcmp (key, mapped->data + here->key, keylen) == 0
+         && here->packet + sizeof (struct datahead) <= datasize)
        {
          /* We found the entry.  Increment the appropriate counter.  */
          const struct datahead *dh
@@ -380,8 +386,7 @@ __nscd_cache_search (request_type type, const char *key, size_t keylen,
 
          /* See whether we must ignore the entry or whether something
             is wrong because garbage collection is in progress.  */
-         if (dh->usable && ((char *) dh + dh->allocsize
-                            <= (char *) mapped->head + mapped->mapsize))
+         if (dh->usable && here->packet + dh->allocsize <= datasize)
            return dh;
        }
 
index 630d54063ae2e09091bc115ad4581d8bc1dc17a9..0079a15a9299564f4ff858f69006e6437372419b 100644 (file)
@@ -1287,8 +1287,15 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
              for (size_t i = 0; i < cur; ++i)
                free (names->name[i]);
              names = names->next;
+             /* NB: we will not leak memory here if we exit without
+                freeing the current block assigned to OLD.  At least
+                the very first block is always allocated on the stack
+                and this is the block assigned to OLD here.  */
              if (names == NULL)
-               break;
+               {
+                 assert (old == &init_names);
+                 break;
+               }
              cur = names->count;
              if (old == names_alloca)
                names_alloca = names;
@@ -1306,8 +1313,15 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
                new_gl_pathv[pglob->gl_offs + pglob->gl_pathc++]
                  = names->name[i];
              names = names->next;
+             /* NB: we will not leak memory here if we exit without
+                freeing the current block assigned to OLD.  At least
+                the very first block is always allocated on the stack
+                and this is the block assigned to OLD here.  */
              if (names == NULL)
-               break;
+               {
+                 assert (old == &init_names);
+                 break;
+               }
              cur = names->count;
              if (old == names_alloca)
                names_alloca = names;
index dd5a57d9e0bae1979ac58e97a303094d99466990..9387e20db24bf55e1604267a0b18f8cd59559f4b 100644 (file)
@@ -1291,8 +1291,8 @@ match_prefix (const struct sockaddr_storage *ss,
   for (idx = 0; ; ++idx)
     {
       unsigned int bits = list[idx].bits;
-      uint8_t *mask = list[idx].prefix.s6_addr;
-      uint8_t *val = in6->sin6_addr.s6_addr;
+      const uint8_t *mask = list[idx].prefix.s6_addr;
+      const uint8_t *val = in6->sin6_addr.s6_addr;
 
       while (bits >= 8)
        {
index 2ec5bd39adf7c63b7aa1a8d87ad95889b40e223e..e399e7c7eb1e7acfadbf3678e14d2eb1412cf3a9 100644 (file)
@@ -1 +1,9 @@
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <sysdep-cancel.h>
+
+#define __sigprocmask(how, set, oset) \
+  INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8)
+
 #include <sysdeps/posix/pause.c>