GNU C Library master sources branch, release/2.11/master, updated. glibc-2.11.1-61-g6d27018

pasky@sourceware.org pasky@sourceware.org
Wed May 12 02:27:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.11/master has been updated
       via  6d270188ef3fe10125b8723ed69ebdc9e90e914e (commit)
       via  32901cc363778c71ed4ddf896c054e7450f654c1 (commit)
       via  b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa (commit)
       via  50a66cf51789d82e515951a9d378bfacc0289df7 (commit)
       via  c4e15a30bd196e2201f4d183fc1bdec4f562be10 (commit)
       via  8ef4dbaf6d8faa91ff42a5d7b8b2c29f1c22bed0 (commit)
       via  850121f39d8b0bcf1e5bb2bddd4b50aae708b661 (commit)
       via  15290d70863d800087aa629f035ad4bcb7f1f69b (commit)
       via  ca27df35b7e821a800c9302bc06b7923e1ff59fd (commit)
       via  49c6fd1ff2a550ad407054a2821d654c41e22679 (commit)
       via  59d5bd49df96b85c0e61ee21c74f0c7d91c34304 (commit)
       via  39879d17a46e063c674ecf5532cb8c1f49fc7277 (commit)
       via  1aa9c16a2a1b297b31793b99cc3d5d67e720edb2 (commit)
       via  6b6e2d505cf6e9246872e7f98e338b52922c7b33 (commit)
       via  d75c76e1d74d3c6fe508738abd442aae0365d690 (commit)
       via  443a33d8042f4084d4d1f40a5b973a19bcae9a23 (commit)
       via  52ade99fe57673eccffbcd71dea61692c424930d (commit)
       via  fbca690a79f9b0232acc0e1d8504d62243bcdbb0 (commit)
       via  ed5e4f5aac1d6a4c75d78548255a47881cdfb911 (commit)
       via  1845ca23091e5ff22e8620d5d72eccd9e2775324 (commit)
       via  14b56bb1170bdfc4b3f6435017eab676c19b19bd (commit)
       via  ec2c681f5d94865892b383e6dc7a429e3bf58b11 (commit)
       via  16c1804e696304140e54108ddd2889cf7b54b768 (commit)
       via  159aeed982dc4c36de78027d262be8370e2f35a0 (commit)
       via  043ea9e79d25398e8e0025b48444257e9e48029c (commit)
       via  ea614f680d5ede741bb2511364d190bceb9073b2 (commit)
       via  6c4a23bc8d85165623b6331fab43cef8d18671db (commit)
       via  02c9c5d2be470a498e707e0a7815ab9833b73a28 (commit)
       via  888fec4045838c19406cbe942bd8541e9cc9db77 (commit)
       via  64a532ff2c8cc914b1850a10ce7ca2a945c21098 (commit)
       via  9914417d124400a5b4104a9d8ef8d46d1d464c6e (commit)
       via  8469d71f1ffc0c910f69b9097fafdcf6594e108f (commit)
       via  f273badc6b317d8d0ba9ba52e873c98a7e72a4e7 (commit)
       via  877103176f621c64bdd847e2db49205de7e32e61 (commit)
       via  7dab764e6058b7383d76f0ba2b63ae3afbafd4ba (commit)
       via  a82e74eb468e899f7ebe4204eefa04a967002f77 (commit)
       via  fae1e90fa13beb6b84454626df2933ecc0b30c66 (commit)
       via  3c0fb4080d496b788c4e579f130794574eb35e0b (commit)
       via  2da4488386833b4787fc3e364a304bf2201b0aca (commit)
       via  a4b67d9bcd17d19386fada0c26f2dbbf0f192d9f (commit)
       via  f514e0b22795750f91eea596d5cba1845680dbe0 (commit)
       via  69ad8afe74aa5a0aa727553e010ad0dded7721dd (commit)
       via  c648b3046e619146357f706a1d0ccced601e039f (commit)
       via  b204d65517276f8cdaf3a83349d0f1f553da68a2 (commit)
       via  272eb2b141c22d03c1c68050b4ad97b2a0adfc69 (commit)
       via  4aa960e79da30982273b3e572e488c1de635cf53 (commit)
       via  2ce2bf1a9845ad1e0c5c3fa0bdd3601d95a78c45 (commit)
       via  721d1acb10d336ad53dfefff8a515e3c1f2e3791 (commit)
       via  ea8e535ed1178b121e3ad5a5b2ebfd24a3bcf27b (commit)
       via  5238213a22c9e64eff78e1eda1763c6c4bf52bcd (commit)
       via  b95387484e410a20334919b250f1614be468e41c (commit)
       via  b0e8ad9e4b224d9b45def4efbc66618361f18448 (commit)
       via  72fe1ad1520b87137b11c315533594a4e350adea (commit)
       via  e73ad37f1571c67eaa0ea503ae91412f1d7abc6d (commit)
       via  8c55b16c2f2c1fcbfe83916b598ed8c42a70350d (commit)
      from  ec10a41982e257e9829c54eb0092dd9fac91a149 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6d270188ef3fe10125b8723ed69ebdc9e90e914e

commit 6d270188ef3fe10125b8723ed69ebdc9e90e914e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 24 19:47:09 2010 -0800

    Fix typos I added in malloc.c
    
    (cherry picked from commit 9d2569846c520933546353856aafea86a80d9638)

diff --git a/malloc/malloc.c b/malloc/malloc.c
index cdd24a0..b1d43c6 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3936,7 +3936,7 @@ public_vALLOc(size_t bytes)
     if(ar_ptr != &main_arena) {
       ar_ptr = &main_arena;
       (void)mutex_lock(&ar_ptr->mutex);
-      p = _int_memalign(&ar_ptr-> pagesz, bytes);
+      p = _int_memalign(ar_ptr, pagesz, bytes);
       (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS
@@ -3982,7 +3982,7 @@ public_pVALLOc(size_t bytes)
     if(ar_ptr != &main_arena) {
       ar_ptr = &main_arena;
       (void)mutex_lock(&ar_ptr->mutex);
-      p = _int_memalign(&ar_ptr-> pagesz, rounded_bytes);
+      p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
       (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=32901cc363778c71ed4ddf896c054e7450f654c1

commit 32901cc363778c71ed4ddf896c054e7450f654c1
Author: Roland McGrath <roland@redhat.com>
Date:   Fri May 7 16:23:03 2010 -0700

    Fix a const warning in ldconfig.
    
    (cherry picked from commit 3f7dcb2b0f9f2e771f2fd0139f032198c2d01ba9)

diff --git a/ChangeLog b/ChangeLog
index 921df9b..5e6a6b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-07  Roland McGrath  <roland@redhat.com>
+
+	* elf/ldconfig.c (main): Add a const.
+
 2010-05-04  Andreas Schwab  <schwab@redhat.com>
 
 	* posix/regexec.c (find_collation_sequence_value): Fix skipping
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index da77d80..6e71b09 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1357,7 +1357,7 @@ main (int argc, char **argv)
 	add_system_dir (LIBDIR);
     }
 
-  char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+  const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
   if (opt_chroot)
     {
       aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa

commit b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed May 5 09:59:25 2010 -0700

    Fix lookup of collation sequence value during regexp matching
    
    (cherry picked from commit d84acf388ed8b3f162dda0512139095bfc268beb)

diff --git a/ChangeLog b/ChangeLog
index 373742c..921df9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-04  Andreas Schwab  <schwab@redhat.com>
+
+	* posix/regexec.c (find_collation_sequence_value): Fix skipping
+	the wide char sequence of the collating element.
+
 2010-05-03  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11149]
diff --git a/posix/regexec.c b/posix/regexec.c
index 7bf0c08..8481b61 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -3998,7 +3998,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
 	  /* Skip the collation sequence value.  */
 	  idx += sizeof (uint32_t);
 	  /* Skip the wide char sequence of the collating element.  */
-	  idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
+	  idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
 	  /* If we found the entry, return the sequence value.  */
 	  if (found)
 	    return *(uint32_t *) (extra + idx);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=50a66cf51789d82e515951a9d378bfacc0289df7

commit 50a66cf51789d82e515951a9d378bfacc0289df7
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon May 3 14:04:52 2010 -0700

    Fix ldconfig to handle symlinks in chroot correctly.
    
    (cherry picked from commit 7dee26605bf8627f0673f81635c38c8a565dd2b7)

diff --git a/ChangeLog b/ChangeLog
index 99638b6..373742c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-05-03  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11149]
+	* elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.
+
 	* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
 
 	* elf/ldconfig.c (parse_conf_include): Don't fall back to
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 0d07a60..da77d80 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -773,7 +773,18 @@ search_dir (const struct dir_entry *entry)
 	{
 	  /* In case of symlink, we check if the symlink refers to
 	     a directory. */
-	  if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
+	  char *target_name = real_file_name;
+	  if (opt_chroot)
+	    {
+	      target_name = chroot_canon (opt_chroot, file_name);
+	      if (target_name == NULL)
+		{
+		  if (strstr (file_name, ".so") == NULL)
+		    error (0, 0, _("Input file %s not found.\n"), file_name);
+		  continue;
+		}
+	    }
+	  if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
 	    {
 	      if (opt_verbose)
 		error (0, errno, _("Cannot stat %s"), file_name);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c4e15a30bd196e2201f4d183fc1bdec4f562be10

commit c4e15a30bd196e2201f4d183fc1bdec4f562be10
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon May 3 13:33:13 2010 -0700

    Simplify OOM handling in ldconfig.
    
    (cherry picked from commit f2976023940a8ef3bbe0c7e593897e1b612370f1)

diff --git a/ChangeLog b/ChangeLog
index 48f9aa9..99638b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2010-05-03  Ulrich Drepper  <drepper@redhat.com>
 
+	* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
+
 	* elf/ldconfig.c (parse_conf_include): Don't fall back to
 	directories named in config file outside the chroot.
 
diff --git a/elf/chroot_canon.c b/elf/chroot_canon.c
index 3c16a43..54a6a4c 100644
--- a/elf/chroot_canon.c
+++ b/elf/chroot_canon.c
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file inside chroot.
-   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005
+   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -58,9 +58,7 @@ chroot_canon (const char *chroot, const char *name)
       return NULL;
     }
 
-  rpath = malloc (chroot_len + PATH_MAX);
-  if (rpath == NULL)
-    return NULL;
+  rpath = xmalloc (chroot_len + PATH_MAX);
 
   rpath_limit = rpath + chroot_len + PATH_MAX;
 
@@ -109,9 +107,7 @@ chroot_canon (const char *chroot, const char *name)
 		new_size += end - start + 1;
 	      else
 		new_size += PATH_MAX;
-	      new_rpath = (char *) realloc (rpath, new_size);
-	      if (new_rpath == NULL)
-		goto error;
+	      new_rpath = (char *) xrealloc (rpath, new_size);
 	      rpath = new_rpath;
 	      rpath_limit = rpath + new_size;
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8ef4dbaf6d8faa91ff42a5d7b8b2c29f1c22bed0

commit 8ef4dbaf6d8faa91ff42a5d7b8b2c29f1c22bed0
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon May 3 10:40:30 2010 -0700

    One more bug in ldconfig -r handling.
    
    (cherry picked from commit 49bd556d43f55d0bb6d76d57e846af85f0c986c9)

diff --git a/ChangeLog b/ChangeLog
index eb9a577..48f9aa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-03  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/ldconfig.c (parse_conf_include): Don't fall back to
+	directories named in config file outside the chroot.
+
 2010-05-02  Ulrich Drepper  <drepper@redhat.com>
 
 	* misc/mntent_r.c (encode_name): The slow loop handles newlines so we
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 7607527..0d07a60 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1174,7 +1174,9 @@ parse_conf_include (const char *config_file, unsigned int lineno,
   if (do_chroot && opt_chroot)
     {
       char *canon = chroot_canon (opt_chroot, pattern);
-      result = glob64 (canon ?: pattern, 0, NULL, &gl);
+      if (canon == NULL)
+	return;
+      result = glob64 (canon, 0, NULL, &gl);
       free (canon);
     }
   else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=850121f39d8b0bcf1e5bb2bddd4b50aae708b661

commit 850121f39d8b0bcf1e5bb2bddd4b50aae708b661
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun May 2 12:12:55 2010 -0700

    Fix handling if newline in addmntent.
    
    (cherry picked from commit ab00f4eac8f4932211259ff87be83144f5211540)

diff --git a/ChangeLog b/ChangeLog
index 3d9f1b5..eb9a577 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-02  Ulrich Drepper  <drepper@redhat.com>
+
+	* misc/mntent_r.c (encode_name): The slow loop handles newlines so we
+	should recognize them as an abort condition.
+	Patch by Jan Lieskovsky <jlieskov@redhat.com>.
+
 2010-04-25  Bruno Haible  <bruno@clisp.org>
 
 	[BZ #11538]
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 829750b..9598528 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -1,5 +1,5 @@
 /* Utilities for reading/writing fstab, mtab, etc.
-   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006
+   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -194,7 +194,7 @@ weak_alias (__getmntent_r, getmntent_r)
     const char *rp = name;						      \
 									      \
     while (*rp != '\0')							      \
-      if (*rp == ' ' || *rp == '\t' || *rp == '\\')			      \
+      if (*rp == ' ' || *rp == '\t' || *rp == '\n' || *rp == '\\')	      \
 	break;								      \
       else								      \
 	++rp;								      \
@@ -202,7 +202,7 @@ weak_alias (__getmntent_r, getmntent_r)
     if (*rp != '\0')							      \
       {									      \
 	/* In the worst case the length of the string can increase to	      \
-	   founr times the current length.  */				      \
+	   four times the current length.  */				      \
 	char *wp;							      \
 									      \
 	rp = name;							      \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=15290d70863d800087aa629f035ad4bcb7f1f69b

commit 15290d70863d800087aa629f035ad4bcb7f1f69b
Author: Bruno Haible <bruno@clisp.org>
Date:   Wed Apr 28 15:00:14 2010 -0700

    BZ #11538: Fix ttyname_r callers not to expect errno was set.
    
    (cherry picked from commit 8c0677fe5d91b7269364ca08fa08ed09e4c2d8c9)

diff --git a/ChangeLog b/ChangeLog
index 1500f3e..3d9f1b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-04-25  Bruno Haible  <bruno@clisp.org>
 
+	[BZ #11538]
+	* sysdeps/unix/bsd/ptsname.c (__ptsname_r): Use __ttyname_r's return
+	value instead of errno.
+	* sysdeps/unix/getlogin.c (getlogin): Likewise.
+
 	[BZ #11537]
 	* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
 	errno, not -1.
diff --git a/sysdeps/unix/bsd/ptsname.c b/sysdeps/unix/bsd/ptsname.c
index fd446a4..6063201 100644
--- a/sysdeps/unix/bsd/ptsname.c
+++ b/sysdeps/unix/bsd/ptsname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2002,2010 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
@@ -44,6 +44,7 @@ int
 __ptsname_r (int fd, char *buf, size_t buflen)
 {
   int save_errno = errno;
+  int err;
   struct stat st;
 
   if (buf == NULL)
@@ -62,8 +63,12 @@ __ptsname_r (int fd, char *buf, size_t buflen)
       return ERANGE;
     }
 
-  if (__ttyname_r (fd, buf, buflen) != 0)
-    return errno;
+  err = __ttyname_r (fd, buf, buflen);
+  if (err != 0)
+    {
+      __set_errno (err);
+      return errno;
+    }
 
   buf[sizeof (_PATH_DEV) - 1] = 't';
 
diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c
index 4752685..7345af0 100644
--- a/sysdeps/unix/getlogin.c
+++ b/sysdeps/unix/getlogin.c
@@ -33,6 +33,7 @@ getlogin (void)
 {
   char tty_pathname[2 + 2 * NAME_MAX];
   char *real_tty_path = tty_pathname;
+  int err;
   char *result = NULL;
   static char name[UT_NAMESIZE + 1];
   struct utmp *ut, line, buffer;
@@ -46,8 +47,12 @@ getlogin (void)
      thing to do.  Note that ttyname(open("/dev/tty")) on those
      systems returns /dev/tty, so that is not a possible solution for
      getlogin().  */
-  if (__ttyname_r (0, real_tty_path, sizeof (tty_pathname)) != 0)
-    return NULL;
+  err = __ttyname_r (0, real_tty_path, sizeof (tty_pathname));
+  if (err != 0)
+    {
+      __set_errno (err);
+      return NULL;
+    }
 
   real_tty_path += 5;		/* Remove "/dev/".  */
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca27df35b7e821a800c9302bc06b7923e1ff59fd

commit ca27df35b7e821a800c9302bc06b7923e1ff59fd
Author: Bruno Haible <bruno@clisp.org>
Date:   Mon Apr 26 10:07:15 2010 -0700

    BZ #11537: Hurd: Fix ttyname_r error return value.
    
    (cherry picked from commit 6cffee3611f324326ae46bb02d2baeb62c0db6a4)

diff --git a/ChangeLog b/ChangeLog
index 33f2cb0..1500f3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-25  Bruno Haible  <bruno@clisp.org>
+
+	[BZ #11537]
+	* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
+	errno, not -1.
+
 2010-04-24  Emilio Pozuelo Monfort  <pochu27@gmail.com>
 
 	* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index 7313b9a..8896252 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 95, 96, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1998,2010 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
@@ -34,13 +34,13 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 
   nodename[0] = '\0';
   if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
-    return __hurd_dfail (fd, err), -1;
+    return __hurd_dfail (fd, err), errno;
 
   len = strlen (nodename) + 1;
   if (len > buflen)
     {
       errno = EINVAL;
-      return -1;
+      return errno;
     }
 
   memcpy (buf, nodename, len);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=49c6fd1ff2a550ad407054a2821d654c41e22679

commit 49c6fd1ff2a550ad407054a2821d654c41e22679
Author: Emilio Pozuelo Monfort <pochu27@gmail.com>
Date:   Mon Apr 26 09:59:30 2010 -0700

    Hurd: Fix file_name_lookup_at error case return value.
    
    (cherry picked from commit 67481400c51229de3efa2eb3dddc8429b6f9e9f4)

diff --git a/ChangeLog b/ChangeLog
index c26934a..33f2cb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-24  Emilio Pozuelo Monfort  <pochu27@gmail.com>
+
+	* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
+
 2010-04-14  Andreas Schwab  <schwab@redhat.com>
 
 	* elf/dl-version.c (_dl_check_map_versions): Avoid index overflow
diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c
index a2d50cb..7f55527 100644
--- a/hurd/lookup-at.c
+++ b/hurd/lookup-at.c
@@ -1,5 +1,5 @@
 /* Lookup helper function for Hurd implementation of *at functions.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006,2010 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
@@ -33,7 +33,7 @@ __file_name_lookup_at (int fd, int at_flags,
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
   if (at_flags != 0)
-    return __hurd_fail (EINVAL);
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
 
   if (fd == AT_FDCWD || file_name[0] == '/')
     return __file_name_lookup (file_name, flags, mode);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=59d5bd49df96b85c0e61ee21c74f0c7d91c34304

commit 59d5bd49df96b85c0e61ee21c74f0c7d91c34304
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Apr 14 22:16:06 2010 -0700

    Don't crash in trace mode when dependencies are missing
    
    (cherry picked from commit 18a26b301b6ab0d68474fbfffb0d17adf69e8824)

diff --git a/ChangeLog b/ChangeLog
index 18e0598..c26934a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-14  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-version.c (_dl_check_map_versions): Avoid index overflow
+	when dependencies are missing.
+
 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
 
 	* nscd/aicache.c (addhstaiX): Correct passing memory to address
diff --git a/elf/dl-version.c b/elf/dl-version.c
index 9e88116..c59a6c3 100644
--- a/elf/dl-version.c
+++ b/elf/dl-version.c
@@ -322,10 +322,14 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
 	      while (1)
 		{
 		  ElfW(Half) ndx = aux->vna_other & 0x7fff;
-		  map->l_versions[ndx].hash = aux->vna_hash;
-		  map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
-		  map->l_versions[ndx].name = &strtab[aux->vna_name];
-		  map->l_versions[ndx].filename = &strtab[ent->vn_file];
+		  /* In trace mode, dependencies may be missing.  */
+		  if (__builtin_expect (ndx < map->l_nversions, 1))
+		    {
+		      map->l_versions[ndx].hash = aux->vna_hash;
+		      map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
+		      map->l_versions[ndx].name = &strtab[aux->vna_name];
+		      map->l_versions[ndx].filename = &strtab[ent->vn_file];
+		    }
 
 		  if (aux->vna_next == 0)
 		    /* No more symbols.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=39879d17a46e063c674ecf5532cb8c1f49fc7277

commit 39879d17a46e063c674ecf5532cb8c1f49fc7277
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Apr 9 21:38:20 2010 -0700

    Fix crash on reloading of gai data in nscd.
    
    (cherry picked from commit ea42a20caed5b343ff20a0d4622ae6c17b77161b)

diff --git a/ChangeLog b/ChangeLog
index 1339765..18e0598 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-04-09  Ulrich Drepper  <drepper@redhat.com>
+
+	* nscd/aicache.c (addhstaiX): Correct passing memory to address
+	list to gethostbyname4_r functions.
+
+	* resolv/nss_dns/dns-host.c (gaih_getanswer_slice): Optimize
+	copying of h_name.
+
 2010-04-07  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/i386/fallocate.c: Set errno on error.
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 992357d..3cb2208 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -1,5 +1,5 @@
 /* Cache handling for host lookup.
-   Copyright (C) 2004-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2004-2008, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
 
@@ -111,7 +111,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
   int old_res_options = _res.options;
   _res.options &= ~RES_USE_INET6;
 
-  size_t tmpbuf6len = 512;
+  size_t tmpbuf6len = 1024;
   char *tmpbuf6 = alloca (tmpbuf6len);
   size_t tmpbuf4len = 0;
   char *tmpbuf4 = NULL;
@@ -133,9 +133,11 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
 							 "gethostbyname4_r");
       if (fct4 != NULL)
 	{
-	  struct gaih_addrtuple *at = NULL;
+	  struct gaih_addrtuple atmem;
+	  struct gaih_addrtuple *at;
 	  while (1)
 	    {
+	      at = &atmem;
 	      rc6 = 0;
 	      herrno = 0;
 	      status[1] = DL_CALL_FCT (fct4, (key, &at, tmpbuf6, tmpbuf6len,
@@ -153,7 +155,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
 	    goto next_nip;
 
 	  /* We found the data.  Count the addresses and the size.  */
-	  for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
+	  for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
 	       at2 = at2->next)
 	    {
 	      ++naddrs;
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index e0c4978..8592183 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -1050,7 +1050,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
 	  ++had_error;
 	  continue;
 	}
-      if (*firstp)
+      if (*firstp && canon == NULL)
 	{
 	  h_name = buffer;
 	  buffer += h_namelen;
@@ -1166,19 +1166,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
 	  if (ttl != 0 && ttlp != NULL)
 	    *ttlp = ttl;
 
-	  if (canon != NULL)
-	    {
-	      (*pat)->name = canon;
-
-	      /* Reclaim buffer space.  */
-	      if (h_name + h_namelen == buffer)
-		{
-		  buffer = h_name;
-		  buflen += h_namelen;
-		}
-	    }
-	  else
-	    (*pat)->name = h_name;
+	  (*pat)->name = canon ?: h_name;
 
 	  *firstp = 0;
 	}

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1aa9c16a2a1b297b31793b99cc3d5d67e720edb2

commit 1aa9c16a2a1b297b31793b99cc3d5d67e720edb2
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Apr 8 15:44:55 2010 -0700

    Fix fallocate error return on i386.
    
    (cherry picked from commit de240a05b3638879af2f9ab663c56ad8b26b1ad3)

diff --git a/ChangeLog b/ChangeLog
index e2a23b7..1339765 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-07  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/fallocate.c: Set errno on error.
+	* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
+
 2009-12-01  Eric Blake  <ebb9@byu.net>
 
 	[BZ #11039]
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c
index 14e7883..1434a83 100644
--- a/sysdeps/unix/sysv/linux/i386/fallocate.c
+++ b/sysdeps/unix/sysv/linux/i386/fallocate.c
@@ -30,7 +30,13 @@ int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return __call_fallocate (fd, mode, offset, len);
+  int err = __call_fallocate (fd, mode, offset, len);
+  if (__builtin_expect (err, 0))
+    {
+      __set_errno (err);
+      err = -1;
+    }
+  return err;
 #else
   __set_errno (ENOSYS);
   return -1;
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c
index 85f315c..063bab0 100644
--- a/sysdeps/unix/sysv/linux/i386/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c
@@ -30,7 +30,13 @@ int
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  return __call_fallocate (fd, mode, offset, len);
+  int err = __call_fallocate (fd, mode, offset, len);
+  if (__builtin_expect (err, 0))
+    {
+      __set_errno (err);
+      err = -1;
+    }
+  return err;
 #else
   __set_errno (ENOSYS);
   return -1;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6b6e2d505cf6e9246872e7f98e338b52922c7b33

commit 6b6e2d505cf6e9246872e7f98e338b52922c7b33
Author: Eric Blake <ebb9@byu.net>
Date:   Wed Apr 7 17:56:20 2010 -0700

    getopt mishandles optstring of "+:"
    
    (cherry picked from commit 66b93be793af309fb78d54199aed2306650079d0)

diff --git a/ChangeLog b/ChangeLog
index 1497e85..e2a23b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-12-01  Eric Blake  <ebb9@byu.net>
 
+	[BZ #11039]
+	* posix/getopt.c (_getopt_internal_r): Skip optional - or + before
+	checking lead byte of optstring for :.
+
 	[BZ #11040]
 	* posix/getopt.c (_getopt_internal_r): Reject '-;' as short
 	option, since it conflicts with "W;" optstring extension.
diff --git a/posix/getopt.c b/posix/getopt.c
index b778047..2746364 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -395,8 +395,6 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		    int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
-  if (optstring[0] == ':')
-    print_errors = 0;
 
   if (argc < 1)
     return -1;
@@ -411,6 +409,10 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 				      posixly_correct);
       d->__initialized = 1;
     }
+  else if (optstring[0] == '-' || optstring[0] == '+')
+    optstring++;
+  if (optstring[0] == ':')
+    print_errors = 0;
 
   /* Test whether ARGV[optind] points to a non-option argument.
      Either it does not have option syntax, or there is an environment flag

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d75c76e1d74d3c6fe508738abd442aae0365d690

commit d75c76e1d74d3c6fe508738abd442aae0365d690
Author: Eric Blake <ebb9@byu.net>
Date:   Wed Apr 7 17:28:36 2010 -0700

    getopt mistakenly allows '-;' as short option
    
    (cherry picked from commit cf0b68196c837ad591f0e7fc0f8e8a0f690b847c)

diff --git a/ChangeLog b/ChangeLog
index 9e247e8..1497e85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2009-12-02  Eric Blake	<ebb9@byu.net>
+2009-12-01  Eric Blake  <ebb9@byu.net>
+
+	[BZ #11040]
+	* posix/getopt.c (_getopt_internal_r): Reject '-;' as short
+	option, since it conflicts with "W;" optstring extension.
+
+2009-12-02  Eric Blake  <ebb9@byu.net>
 
 	[BZ #11041]
 	* posix/getopt.c (_getopt_internal_r): Handle '-Wfoo' identically
diff --git a/posix/getopt.c b/posix/getopt.c
index 01c1071..b778047 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -789,7 +789,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
     if (*d->__nextchar == '\0')
       ++d->optind;
 
-    if (temp == NULL || c == ':')
+    if (temp == NULL || c == ':' || c == ';')
       {
 	if (print_errors)
 	  {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=443a33d8042f4084d4d1f40a5b973a19bcae9a23

commit 443a33d8042f4084d4d1f40a5b973a19bcae9a23
Author: Eric Blake <ebb9@byu.net>
Date:   Wed Apr 7 17:16:27 2010 -0700

    Fix -W with optional parameters in getopt.
    
    According to the getopt documentation, if "W;" is part of optstring, then '-W
    foo' should behave like '--foo'.  But if "foo" uses an optional_argument, this
    is not the case, since optarg is not NULL when using -W.
    
    (cherry picked from commit aa7f642769abcfbce658aeaaffdc9fb4790cd905)

diff --git a/ChangeLog b/ChangeLog
index 6df5c04..9e247e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-02  Eric Blake	<ebb9@byu.net>
+
+	[BZ #11041]
+	* posix/getopt.c (_getopt_internal_r): Handle '-Wfoo' identically
+	to '--foo', with optional argument or non-ambiguous prefix.
+
 2010-04-05  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11010]
diff --git a/posix/getopt.c b/posix/getopt.c
index 88acff0..01c1071 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -911,7 +911,10 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		  pfound = p;
 		  indfound = option_index;
 		}
-	      else
+	      else if (long_only
+		       || pfound->has_arg != p->has_arg
+		       || pfound->flag != p->flag
+		       || pfound->val != p->val)
 		/* Second or later nonexact match found.  */
 		ambig = 1;
 	    }
@@ -1028,6 +1031,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		    return optstring[0] == ':' ? ':' : '?';
 		  }
 	      }
+	    else
+	      d->optarg = NULL;
 	    d->__nextchar += strlen (d->__nextchar);
 	    if (longind != NULL)
 	      *longind = option_index;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=52ade99fe57673eccffbcd71dea61692c424930d

commit 52ade99fe57673eccffbcd71dea61692c424930d
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Apr 5 12:21:20 2010 -0700

    Handle DNS timeouts in old-style lookkup code.
    
    (cherry picked from commit 4535680d03d15dc9ce19d97b9d242a10941d5016)

diff --git a/ChangeLog b/ChangeLog
index 26c4e2f..6df5c04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-05  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11010]
+	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Handle
+	timeouts from servers.
+
 	[BZ #11149]
 	* elf/ldconfig.c (main): Respect chroot setting when looking for
 	the aux cache.
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 818a40a..e0c4978 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -198,21 +198,27 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result,
 			  1024, &host_buffer.ptr, NULL, NULL, NULL);
   if (n < 0)
     {
-      if (errno == ESRCH)
+      switch (errno)
 	{
+	case ESRCH:
 	  status = NSS_STATUS_TRYAGAIN;
 	  h_errno = TRY_AGAIN;
+	  break;
+	case ECONNREFUSED:
+	case ETIMEDOUT:
+	  status = NSS_STATUS_UNAVAIL;
+	  break;
+	default:
+	  status = NSS_STATUS_NOTFOUND;
+	  break;
 	}
-      else
-	status = (errno == ECONNREFUSED
-		  ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
       *h_errnop = h_errno;
       if (h_errno == TRY_AGAIN)
 	*errnop = EAGAIN;
       else
 	__set_errno (olderr);
 
-      /* If we are looking for a IPv6 address and mapping is enabled
+      /* If we are looking for an IPv6 address and mapping is enabled
 	 by having the RES_USE_INET6 bit in _res.options set, we try
 	 another lookup.  */
       if (af == AF_INET6 && (_res.options & RES_USE_INET6))

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fbca690a79f9b0232acc0e1d8504d62243bcdbb0

commit fbca690a79f9b0232acc0e1d8504d62243bcdbb0
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Apr 5 11:26:43 2010 -0700

    Fix aux cache handling in ldconfig with chroot.
    
    (cherry picked from commit 4bc2bcba67e870778fb9397f29435ee1b66bebf3)

diff --git a/ChangeLog b/ChangeLog
index 2941812..26c4e2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-05  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11149]
+	* elf/ldconfig.c (main): Respect chroot setting when looking for
+	the aux cache.
+
 2010-04-04  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11043]
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 78a0f0c..7607527 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1305,11 +1305,9 @@ main (int argc, char **argv)
 				  p ? (*p = '\0', cache_file) : "/");
 
       if (canon == NULL)
-	{
-	  error (EXIT_FAILURE, errno,
-		 _("Can't open cache file directory %s\n"),
-		 p ? cache_file : "/");
-	}
+	error (EXIT_FAILURE, errno,
+	       _("Can't open cache file directory %s\n"),
+	       p ? cache_file : "/");
 
       if (p)
 	++p;
@@ -1346,8 +1344,17 @@ main (int argc, char **argv)
 	add_system_dir (LIBDIR);
     }
 
+  char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+  if (opt_chroot)
+    {
+      aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+      if (aux_cache_file == NULL)
+	error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
+	       _PATH_LDCONFIG_AUX_CACHE);
+    }
+
   if (! opt_ignore_aux_cache)
-    load_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
+    load_aux_cache (aux_cache_file);
   else
     init_aux_cache ();
 
@@ -1356,7 +1363,7 @@ main (int argc, char **argv)
   if (opt_build_cache)
     {
       save_cache (cache_file);
-      save_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
+      save_aux_cache (aux_cache_file);
     }
 
   return 0;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ed5e4f5aac1d6a4c75d78548255a47881cdfb911

commit ed5e4f5aac1d6a4c75d78548255a47881cdfb911
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 4 22:48:55 2010 -0700

    Fix printing error messages in getopt.
    
    (cherry picked from commit 247fdc8ee68cf49cd808becce56b2e923b4f776b)

diff --git a/ChangeLog b/ChangeLog
index 44659bb..2941812 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-04  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11043]
+	* posix/getopt.c (_getopt_internal_r): Fix arguments printed in error
+	messages.
+
 	[BZ #11070]
 	* resolv/netdb.h: Declare iruserok and iruserok_af.
 
diff --git a/posix/getopt.c b/posix/getopt.c
index a7f0b54..88acff0 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -2,7 +2,8 @@
    NOTE: getopt is part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to drepper@gnu.org
    before changing it!
-   Copyright (C) 1987-1996,1998-2004,2008,2009 Free Software Foundation, Inc.
+   Copyright (C) 1987-1996,1998-2004,2008,2009,2010
+   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
@@ -679,8 +680,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		      char *buf;
 
 		      if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-				      argv[0], argv[d->optind - 1]) >= 0)
+%s: option '--%s' requires an argument\n"),
+				      argv[0], pfound->name) >= 0)
 			{
 			  _IO_flockfile (stderr);
 
@@ -697,8 +698,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			}
 #else
 		      fprintf (stderr,
-			       _("%s: option '%s' requires an argument\n"),
-			       argv[0], argv[d->optind - 1]);
+			       _("%s: option '--%s' requires an argument\n"),
+			       argv[0], pfound->name);
 #endif
 		    }
 		  d->__nextchar += strlen (d->__nextchar);
@@ -922,7 +923,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		char *buf;
 
 		if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
-				argv[0], argv[d->optind]) >= 0)
+				argv[0], d->optarg) >= 0)
 		  {
 		    _IO_flockfile (stderr);
 
@@ -938,7 +939,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		  }
 #else
 		fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
-			 argv[0], argv[d->optind]);
+			 argv[0], d->optarg);
 #endif
 	      }
 	    d->__nextchar += strlen (d->__nextchar);
@@ -1001,8 +1002,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			char *buf;
 
 			if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-					argv[0], argv[d->optind - 1]) >= 0)
+%s: option '-W %s' requires an argument\n"),
+					argv[0], pfound->name) >= 0)
 			  {
 			    _IO_flockfile (stderr);
 
@@ -1018,9 +1019,9 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			    free (buf);
 			  }
 #else
-			fprintf (stderr,
-				 _("%s: option '%s' requires an argument\n"),
-				 argv[0], argv[d->optind - 1]);
+			fprintf (stderr, _("\
+%s: option '-W %s' requires an argument\n"),
+				 argv[0], pfound->name);
 #endif
 		      }
 		    d->__nextchar += strlen (d->__nextchar);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1845ca23091e5ff22e8620d5d72eccd9e2775324

commit 1845ca23091e5ff22e8620d5d72eccd9e2775324
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 4 22:01:52 2010 -0700

    Declare iruserok and iruserok_af.
    
    (cherry picked from commit 2cd9670885d32eed6f4de12ddbeb2a9d049f198e)

diff --git a/ChangeLog b/ChangeLog
index 8f3aef4..44659bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-04-04  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11070]
+	* resolv/netdb.h: Declare iruserok and iruserok_af.
+
 	* argp/Makefile: Add rules to build and run bug-argp2.
 	* argp/bug-argp2.c: New file.
 
diff --git a/resolv/netdb.h b/resolv/netdb.h
index dc1f7ce..06e9a9a 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -516,6 +516,30 @@ extern int ruserok_af (__const char *__rhost, int __suser,
 		       __const char *__remuser, __const char *__locuser,
 		       sa_family_t __af);
 
+/* Check whether user REMUSER on system indicated by IPv4 address
+   RADDR is allowed to login as LOCUSER.  Non-IPv4 (e.g., IPv6) are
+   not supported.  If SUSER is not zero the user tries to become
+   superuser.  Return 0 if it is possible.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok (uint32_t __raddr, int __suser,
+		     __const char *__remuser, __const char *__locuser);
+
+/* This is the equivalent function where the pfamiliy if the address
+   pointed to by RADDR is determined by the value of AF.  It therefore
+   can be used for IPv6
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok_af (__const void *__raddr, int __suser,
+			__const char *__remuser, __const char *__locuser,
+			sa_family_t __af);
+
 /* Try to allocate reserved port, returning a descriptor for a socket opened
    at this port or -1 if unsuccessful.  The search for an available port
    will start at ALPORT and continues with lower numbers.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=14b56bb1170bdfc4b3f6435017eab676c19b19bd

commit 14b56bb1170bdfc4b3f6435017eab676c19b19bd
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 4 11:28:36 2010 -0700

    Add test case for last argp bug.
    
    (cherry picked from commit 7ebaec64a0171a54dbe9aedd95497b130458060e)

diff --git a/ChangeLog b/ChangeLog
index db3d121..8f3aef4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-04  Ulrich Drepper  <drepper@redhat.com>
+
+	* argp/Makefile: Add rules to build and run bug-argp2.
+	* argp/bug-argp2.c: New file.
+
 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
 
 	[BZ #11254]
diff --git a/argp/Makefile b/argp/Makefile
index b8c9fca..caa95db 100644
--- a/argp/Makefile
+++ b/argp/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1997,2002,2003,2006,2007,2010 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
@@ -26,12 +26,13 @@ distribute	= argp-fmtstream.h argp-namefrob.h
 routines	= $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
 				     pvh xinl eexst)
 
-tests		= argp-test tst-argp1 bug-argp1 tst-argp2
+tests		= argp-test tst-argp1 bug-argp1 tst-argp2 bug-argp2
 
 CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
 CFLAGS-argp-parse.c = $(uses-callbacks)
 CFLAGS-argp-fmtstream.c = -fexceptions
 
 bug-argp1-ARGS = -- --help
+bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
 
 include ../Rules
diff --git a/argp/bug-argp2.c b/argp/bug-argp2.c
new file mode 100644
index 0000000..133e5cf
--- /dev/null
+++ b/argp/bug-argp2.c
@@ -0,0 +1,55 @@
+#include <argp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static struct argp_option argp_options[] = {
+  { "dstaddr", 'd', "ADDR", 0,
+    "set destination (peer) address to ADDR" },
+  { "peer", 'p', "ADDR", OPTION_ALIAS },
+  { NULL }
+};
+
+static error_t parse_opt (int key, char *arg, struct argp_state *state);
+
+static struct argp argp =
+{
+  argp_options, parse_opt
+};
+
+static int cnt;
+
+static int
+do_test (int argc, char *argv[])
+{
+  int remaining;
+  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+  return cnt != 4;
+}
+
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+  {
+  case 'd':
+  case 'p':
+    printf ("got '%c' with argument '%s'\n", key, arg);
+    ++cnt;
+    break;
+  case 0:
+  case ARGP_KEY_END:
+  case ARGP_KEY_NO_ARGS:
+  case ARGP_KEY_INIT:
+  case ARGP_KEY_SUCCESS:
+  case ARGP_KEY_FINI:
+    // Ignore.
+    return ARGP_ERR_UNKNOWN;
+  default:
+    printf ("invalid key '%x'\n", key);
+    exit (1);
+  }
+  return 0;
+}
+
+#define TEST_FUNCTION do_test (argc, argv)
+#include "../test-skeleton.c"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ec2c681f5d94865892b383e6dc7a429e3bf58b11

commit ec2c681f5d94865892b383e6dc7a429e3bf58b11
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Sun Apr 4 10:04:55 2010 -0700

    Fix option aliasing in argp.
    
    (cherry picked from commit 8c6de69d00c6be60657ca0d763dda803172c6aab)

diff --git a/ChangeLog b/ChangeLog
index 4ccc115..db3d121 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
+
+	[BZ #11254]
+	* argp/argp-parse.c (convert_options): Fix improper use of `|'
+	between character values.
+
 2010-04-04  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11287]
diff --git a/argp/argp-parse.c b/argp/argp-parse.c
index 4718ced..604fcf0 100644
--- a/argp/argp-parse.c
+++ b/argp/argp-parse.c
@@ -1,5 +1,5 @@
 /* Hierarchial argument parsing, layered over getopt
-   Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Miles Bader <miles@gnu.ai.mit.edu>.
 
@@ -99,7 +99,7 @@ static volatile int _argp_hang;
 
 static const struct argp_option argp_default_options[] =
 {
-  {"help",	  '?',    	0, 0,  N_("Give this help list"), -1},
+  {"help",	  '?',	  	0, 0,  N_("Give this help list"), -1},
   {"usage",	  OPT_USAGE,	0, 0,  N_("Give a short usage message")},
   {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
   {"HANG",	  OPT_HANG,    "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
@@ -164,7 +164,7 @@ static const struct argp argp_default_argp =
 
 static const struct argp_option argp_version_options[] =
 {
-  {"version",	  'V',    	0, 0,  N_("Print program version"), -1},
+  {"version",	  'V',	  	0, 0,  N_("Print program version"), -1},
   {0, 0}
 };
 
@@ -364,7 +364,7 @@ convert_options (const struct argp *argp,
 		       values (the sign of the lower bits is preserved
 		       however)...  */
 		    cvt->long_end->val =
-		      ((opt->key | real->key) & USER_MASK)
+		      ((opt->key ? opt->key : real->key) & USER_MASK)
 		      + (((group - cvt->parser->groups) + 1) << USER_BITS);
 
 		    /* Keep the LONG_OPTS list terminated.  */
@@ -385,7 +385,7 @@ convert_options (const struct argp *argp,
 
       if (children)
 	/* Assign GROUP's CHILD_INPUTS field some space from
-           CVT->child_inputs_end.*/
+	   CVT->child_inputs_end.*/
 	{
 	  unsigned num_children = 0;
 	  while (children[num_children].argp)
@@ -823,7 +823,7 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
 	  parser->try_getopt = 0;
 	  if (parser->state.next > 1
 	      && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
-	           == 0)
+		   == 0)
 	    /* Not only is this the end of the options, but it's a
 	       `quoted' region, which may have args that *look* like
 	       options, so we definitely shouldn't try to use getopt past

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=16c1804e696304140e54108ddd2889cf7b54b768

commit 16c1804e696304140e54108ddd2889cf7b54b768
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 4 01:02:09 2010 -0700

    Fix retrieving of kernel header version.
    (cherry picked from commit 9e37946dba22b53c5108eef777e867f93c894502)

diff --git a/ChangeLog b/ChangeLog
index 75bd6b8..4ccc115 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-04  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11287]
+	* csu/Makefile ($(objpfx)version-info.h): Handle newer kernel headers
+	which don't define UTS_RELEASE.
+
 2010-04-04  H.J. Lu  <hongjiu.lu@intel.com>
 	    Ulrich Drepper  <drepper@redhat.com>
 
diff --git a/csu/Makefile b/csu/Makefile
index 0e2ae07..69e07c7 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -1,5 +1,5 @@
 # Makefile for csu code for GNU C library.
-# Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1995-2004, 2005, 2006, 2010 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
@@ -209,9 +209,20 @@ $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
 	   linux*) version=`(printf '%s\n%s\n' \
 				    '#include <linux/version.h>' \
 				    UTS_RELEASE \
-			     | $(CC) $(CPPFLAGS) -E -P - -DNOT_IN_libc=1 | \
+			     | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 | \
 			     sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
 		   if [ -z "$$version" ]; then \
+		     version=`(printf '%s\n%s\n' \
+				      '#include <linux/version.h>' \
+				       LINUX_VERSION_CODE \
+			       | $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 \
+			       | sed -n -e '/^[123456789].*/p' \
+			       | awk '{v=$$1; \
+				       printf("%d.%d.%d\n", \
+					      v/65535, v/256%256, v%256)}') \
+				2>/dev/null`; \
+		   fi; \
+		   if [ -z "$$version" ]; then \
 		     if [ -r /proc/version ]; then \
 		       version=`sed 's/.*Linux version \([^ ]*\) .*/>>\1<</' \
 				< /proc/version`; \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=159aeed982dc4c36de78027d262be8370e2f35a0

commit 159aeed982dc4c36de78027d262be8370e2f35a0
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 4 00:25:46 2010 -0700

    Fix concurrent handling of __cpu_features.
    
    (cherry picked from commit 22f4f44b6727887957aa1d4039eba290b064da63)

diff --git a/ChangeLog b/ChangeLog
index 5c3a1cd..75bd6b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+	    Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11292]
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Allow
+	concurrent initialization and use of __cpu_features.
+
+2010-04-04  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/x86_64/multiarch/init-arch.h (cpu_features): Add tag to
+	the enum.
+
 2010-04-03  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11333]
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index 7823ace..0fe2f86 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -1,6 +1,6 @@
 /* Initialize CPU feature data.
    This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@redhat.com>.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <atomic.h>
 #include <cpuid.h>
 #include "init-arch.h"
 
@@ -26,7 +27,7 @@ struct cpu_features __cpu_features attribute_hidden;
 
 
 static void
-get_common_indeces (void)
+get_common_indeces (unsigned int *family, unsigned int *model)
 {
   __cpuid (1, __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax,
 	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx,
@@ -34,8 +35,8 @@ get_common_indeces (void)
 	   __cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx);
 
   unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
-  __cpu_features.family = (eax >> 8) & 0x0f;
-  __cpu_features.model = (eax >> 4) & 0x0f;
+  *family = (eax >> 8) & 0x0f;
+  *model = (eax >> 4) & 0x0f;
 }
 
 
@@ -45,36 +46,44 @@ __init_cpu_features (void)
   unsigned int ebx;
   unsigned int ecx;
   unsigned int edx;
+  unsigned int family = 0;
+  unsigned int model = 0;
+  enum cpu_features_kind kind;
 
   __cpuid (0, __cpu_features.max_cpuid, ebx, ecx, edx);
 
   /* This spells out "GenuineIntel".  */
   if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
     {
-      __cpu_features.kind = arch_kind_intel;
+      kind = arch_kind_intel;
 
-      get_common_indeces ();
+      get_common_indeces (&family, &model);
 
       unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
       unsigned int extended_family = (eax >> 20) & 0xff;
       unsigned int extended_model = (eax >> 12) & 0xf0;
       if (__cpu_features.family == 0x0f)
 	{
-	  __cpu_features.family += extended_family;
-	  __cpu_features.model += extended_model;
+	  family += extended_family;
+	  model += extended_model;
 	}
       else if (__cpu_features.family == 0x06)
-	__cpu_features.model += extended_model;
+	model += extended_model;
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
     {
-      __cpu_features.kind = arch_kind_amd;
+      kind = arch_kind_amd;
 
-      get_common_indeces ();
+      get_common_indeces (&family, &model);
     }
   else
-    __cpu_features.kind = arch_kind_other;
+    kind = arch_kind_other;
+
+  __cpu_features.family = family;
+  __cpu_features.model = model;
+  atomic_write_barrier ();
+  __cpu_features.kind = kind;
 }
 
 #undef __get_cpu_features
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index 9b12831..f632069 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
 /* This file is part of the GNU C Library.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@ enum
 
 extern struct cpu_features
 {
-  enum
+  enum cpu_features_kind
     {
       arch_kind_unknown = 0,
       arch_kind_intel,

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=043ea9e79d25398e8e0025b48444257e9e48029c

commit 043ea9e79d25398e8e0025b48444257e9e48029c
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 23:51:40 2010 -0700

    Handle unnecessary padding in getdents64.
    
    The getdents64 syscall adds on 32-but platforms padding which isn't needed
    and not included in the userlevel data structure definition.  We have to
    avoid copying those padding bytes in the readdir64_r function.
    
    (cherry picked from commit 1a81139728494810f65aaa0d0c538ff8c2783dd5)

diff --git a/ChangeLog b/ChangeLog
index 300ec4e..5c3a1cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-04-03  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11333]
+	* sysdeps/unix/readdir_r.c (__READDIR_R): Add support for platforms
+	which include unnecessary padding in d_reclen.
+	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Select work-around for
+	unnecessary padding.
+
 	[BZ #11387]
 	* sysdeps/unix/sysv/linux/ifaddrs.c (map_newlin): Don't abort on
 	unknown interface, return -1.
diff --git a/sysdeps/unix/readdir_r.c b/sysdeps/unix/readdir_r.c
index f84709e..9372791 100644
--- a/sysdeps/unix/readdir_r.c
+++ b/sysdeps/unix/readdir_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02,10
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -113,7 +113,17 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
   while (dp->d_ino == 0);
 
   if (dp != NULL)
-    *result = memcpy (entry, dp, reclen);
+    {
+#ifdef GETDENTS_64BIT_ALIGNED
+      /* The d_reclen value might include padding which is not part of
+	 the DIRENT_TYPE data structure.  */
+      reclen = MIN (reclen, sizeof (DIRENT_TYPE));
+#endif
+      *result = memcpy (entry, dp, reclen);
+#ifdef GETDENTS_64BIT_ALIGNED
+      entry->d_reclen = reclen;
+#endif
+    }
   else
     *result = NULL;
 
diff --git a/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
index c6da57b..f96f16a 100644
--- a/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2004, 2010 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
@@ -19,6 +19,7 @@
 #define __READDIR_R __readdir64_r
 #define __GETDENTS __getdents64
 #define DIRENT_TYPE struct dirent64
+#define GETDENTS_64BIT_ALIGNED 1
 
 #include <sysdeps/unix/readdir_r.c>
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ea614f680d5ede741bb2511364d190bceb9073b2

commit ea614f680d5ede741bb2511364d190bceb9073b2
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 23:10:16 2010 -0700

    Add missing include.
    
    (cherry picked from commit 3fedf0feb75457f7098a0119ca4203ff449546b6)

diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
index a556389..7999a30 100644
--- a/crypt/crypt_util.c
+++ b/crypt/crypt_util.c
@@ -27,6 +27,7 @@
 #ifdef DEBUG
 #include <stdio.h>
 #endif
+#include <atomic.h>
 #include <string.h>
 
 #ifndef STATIC

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6c4a23bc8d85165623b6331fab43cef8d18671db

commit 6c4a23bc8d85165623b6331fab43cef8d18671db
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 20:36:59 2010 -0700

    Fix changes to interface list during getifaddrs calls.
    
    (cherry picked from commit b8b14c4cc38883032b8ebae50c9a8b3efd256483)

diff --git a/ChangeLog b/ChangeLog
index 7a6417e..300ec4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-04-03  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11387]
+	* sysdeps/unix/sysv/linux/ifaddrs.c (map_newlin): Don't abort on
+	unknown interface, return -1.
+	(getifaddrs_internal): Rename from getifaddrs.  Handle errors in
+	map_newlink be returning -EAGAIN.
+	(getifaddrs): If -EAGAIN is returned from getifaddrs_internal try
+	again.
+
+2010-04-03  Ulrich Drepper  <drepper@redhat.com>
+
 	[BZ #11438]
 	* posix/gai.conf: Document problems with IPv4 site-local addresses and
 	NATs.
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index 149bd1c..84f223d 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -1,5 +1,5 @@
 /* getifaddrs -- get names and addresses of all network interfaces
-   Copyright (C) 2003-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2008, 2009, 2010 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
@@ -315,17 +315,19 @@ map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
       else if (map[i] == index)
 	return i;
     }
-  /* This should never be reached. If this will be reached, we have
-     a very big problem.  */
-  abort ();
+
+  /* This means interfaces changed inbetween the reading of the
+     RTM_GETLINK and RTM_GETADDR information.  We have to repeat
+     everything.  */
+  return -1;
 }
 
 
 /* Create a linked list of `struct ifaddrs' structures, one for each
    network interface on the host machine.  If successful, store the
    list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
-int
-getifaddrs (struct ifaddrs **ifap)
+static int
+getifaddrs_internal (struct ifaddrs **ifap)
 {
   struct netlink_handle nh = { 0, 0, 0, NULL, NULL };
   struct netlink_res *nlp;
@@ -481,6 +483,13 @@ getifaddrs (struct ifaddrs **ifap)
 		 kernel.  */
 	      ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
 				       map_newlink_data, newlink);
+	      if (__builtin_expect (ifa_index == -1, 0))
+		{
+		try_again:
+		  result = -EAGAIN;
+		  free (ifas);
+		  goto exit_free;
+		}
 	      ifas[ifa_index].ifa.ifa_flags = ifim->ifi_flags;
 
 	      while (RTA_OK (rta, rtasize))
@@ -565,9 +574,11 @@ getifaddrs (struct ifaddrs **ifap)
 		 that we have holes in the interface part of the list,
 		 but we always have already the interface for this address.  */
 	      ifa_index = newlink + newaddr_idx;
-	      ifas[ifa_index].ifa.ifa_flags
-		= ifas[map_newlink (ifam->ifa_index - 1, ifas,
-				    map_newlink_data, newlink)].ifa.ifa_flags;
+	      int idx = map_newlink (ifam->ifa_index - 1, ifas,
+				     map_newlink_data, newlink);
+	      if (__builtin_expect (idx == -1, 0))
+		goto try_again;
+	      ifas[ifa_index].ifa.ifa_flags = ifas[idx].ifa.ifa_flags;
 	      if (ifa_index > 0)
 		ifas[ifa_index - 1].ifa.ifa_next = &ifas[ifa_index].ifa;
 	      ++newaddr_idx;
@@ -747,9 +758,13 @@ getifaddrs (struct ifaddrs **ifap)
 	      /* If we didn't get the interface name with the
 		 address, use the name from the interface entry.  */
 	      if (ifas[ifa_index].ifa.ifa_name == NULL)
-		ifas[ifa_index].ifa.ifa_name
-		  = ifas[map_newlink (ifam->ifa_index - 1, ifas,
-				      map_newlink_data, newlink)].ifa.ifa_name;
+		{
+		  int idx = map_newlink (ifam->ifa_index - 1, ifas,
+					 map_newlink_data, newlink);
+		  if (__builtin_expect (idx == -1, 0))
+		    goto try_again;
+		  ifas[ifa_index].ifa.ifa_name = ifas[idx].ifa.ifa_name;
+		}
 
 	      /* Calculate the netmask.  */
 	      if (ifas[ifa_index].ifa.ifa_addr
@@ -826,6 +841,22 @@ getifaddrs (struct ifaddrs **ifap)
 
   return result;
 }
+
+
+/* Create a linked list of `struct ifaddrs' structures, one for each
+   network interface on the host machine.  If successful, store the
+   list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
+int
+getifaddrs (struct ifaddrs **ifap)
+{
+  int res;
+
+  do
+    res = getifaddrs_internal (ifap);
+  while (res == -EAGAIN);
+
+  return res;
+}
 libc_hidden_def (getifaddrs)
 
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=02c9c5d2be470a498e707e0a7815ab9833b73a28

commit 02c9c5d2be470a498e707e0a7815ab9833b73a28
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 17:56:51 2010 -0700

    Document problem with NATs in getaddrinfo.
    
    (cherry picked from commit ed0874085976531bda8a05540b0816e8bf711b71)

diff --git a/ChangeLog b/ChangeLog
index 42c1a07..7a6417e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,15 +1,15 @@
 2010-04-03  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11438]
+	* posix/gai.conf: Document problems with IPv4 site-local addresses and
+	NATs.
+
 	[BZ #11449]
 	* crypt/crypt_util.c (__init_des_r): Add memory barrier before setting
 	small_tables_initialized.
 
 	* malloc/malloc.c (set_max_fast): Fix computation of the value.
 
-2010-04-03  Ulrich Drepper  <drepper@redhat.com>
-
-	* malloc/malloc.c (set_max_fast): Fix computation of the value.
-
 2010-03-25  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
diff --git a/posix/gai.conf b/posix/gai.conf
index 3dba1a9..195287e 100644
--- a/posix/gai.conf
+++ b/posix/gai.conf
@@ -66,3 +66,12 @@
 #scopev4 ::ffff:172.16.0.0/108   5
 #scopev4 ::ffff:192.168.0.0/112  5
 #scopev4 ::ffff:0.0.0.0/96       14
+#
+#    For sites which use site-local IPv4 addresses behind NAT there is
+#    the problem that even if IPv4 addresses are preferred they do not
+#    have the same scope and are therefore not sorted first.  To change
+#    this use only these rules:
+#
+#scopev4 ::ffff:169.254.0.0/112  2
+#scopev4 ::ffff:127.0.0.0/104    2
+#scopev4 ::ffff:0.0.0.0/96       14

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=888fec4045838c19406cbe942bd8541e9cc9db77

commit 888fec4045838c19406cbe942bd8541e9cc9db77
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 13:45:02 2010 -0700

    Missing memory barrier in DES initialization.
    
    (cherry picked from commit 647450cfb089a60f1dc3de7d68874cd21f475ec7)

diff --git a/ChangeLog b/ChangeLog
index b135268..42c1a07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-04-03  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11449]
+	* crypt/crypt_util.c (__init_des_r): Add memory barrier before setting
+	small_tables_initialized.
+
+	* malloc/malloc.c (set_max_fast): Fix computation of the value.
+
+2010-04-03  Ulrich Drepper  <drepper@redhat.com>
+
 	* malloc/malloc.c (set_max_fast): Fix computation of the value.
 
 2010-03-25  Andreas Schwab  <schwab@redhat.com>
diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
index 0db5be7..a556389 100644
--- a/crypt/crypt_util.c
+++ b/crypt/crypt_util.c
@@ -1,7 +1,7 @@
 /*
  * UFC-crypt: ultra fast crypt(3) implementation
  *
- * Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993,1996-1998,2000,2010 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -114,53 +114,53 @@ static const int perm32[32] = {
  * The sboxes
  */
 static const int sbox[8][4][16]= {
-        { { 14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7 },
-          {  0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8 },
-          {  4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0 },
-          { 15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13 }
-        },
-
-        { { 15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10 },
-          {  3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5 },
-          {  0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15 },
-          { 13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9 }
-        },
-
-        { { 10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8 },
-          { 13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1 },
-          { 13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7 },
-          {  1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12 }
-        },
-
-        { {  7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15 },
-          { 13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9 },
-          { 10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4 },
-          {  3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14 }
-        },
-
-        { {  2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9 },
-          { 14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6 },
-          {  4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14 },
-          { 11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3 }
-        },
-
-        { { 12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11 },
-          { 10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8 },
-          {  9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6 },
-          {  4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13 }
-        },
-
-        { {  4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1 },
-          { 13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6 },
-          {  1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2 },
-          {  6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12 }
-        },
-
-        { { 13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7 },
-          {  1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2 },
-          {  7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8 },
-          {  2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11 }
-        }
+	{ { 14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7 },
+	  {  0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8 },
+	  {  4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0 },
+	  { 15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13 }
+	},
+
+	{ { 15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10 },
+	  {  3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5 },
+	  {  0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15 },
+	  { 13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9 }
+	},
+
+	{ { 10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8 },
+	  { 13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1 },
+	  { 13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7 },
+	  {  1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12 }
+	},
+
+	{ {  7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15 },
+	  { 13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9 },
+	  { 10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4 },
+	  {  3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14 }
+	},
+
+	{ {  2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9 },
+	  { 14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6 },
+	  {  4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14 },
+	  { 11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3 }
+	},
+
+	{ { 12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11 },
+	  { 10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8 },
+	  {  9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6 },
+	  {  4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13 }
+	},
+
+	{ {  4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1 },
+	  { 13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6 },
+	  {  1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2 },
+	  {  6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12 }
+	},
+
+	{ { 13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7 },
+	  {  1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2 },
+	  {  7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8 },
+	  {  2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11 }
+	}
 };
 
 /*
@@ -468,6 +468,7 @@ __init_des_r(__data)
 	  efp[comes_from_word][word_value][o_long] |= mask2;
       }
     }
+    atomic_write_barrier ();
     small_tables_initialized = 1;
 #ifdef __GNU_LIBRARY__
 small_tables_done:

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=64a532ff2c8cc914b1850a10ce7ca2a945c21098

commit 64a532ff2c8cc914b1850a10ce7ca2a945c21098
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Apr 3 09:43:10 2010 -0700

    Fix set_max_fast in malloc.
    
    (cherry picked from commit 991eda1ec17665ea0da247f8eabc6993d020ed8e)

diff --git a/ChangeLog b/ChangeLog
index be91db9..b135268 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-03  Ulrich Drepper  <drepper@redhat.com>
+
+	* malloc/malloc.c (set_max_fast): Fix computation of the value.
+
 2010-03-25  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
diff --git a/malloc/malloc.c b/malloc/malloc.c
index f722676..cdd24a0 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2351,7 +2351,8 @@ typedef struct malloc_chunk* mfastbinptr;
 */
 
 #define set_max_fast(s) \
-  global_max_fast = ((s) == 0)? SMALLBIN_WIDTH: request2size(s)
+  global_max_fast = (((s) == 0)						      \
+		     ? SMALLBIN_WIDTH: ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
 #define get_max_fast() global_max_fast
 
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9914417d124400a5b4104a9d8ef8d46d1d464c6e

commit 9914417d124400a5b4104a9d8ef8d46d1d464c6e
Author: Andreas Schwab <schwab@redhat.com>
Date:   Fri Mar 26 05:35:50 2010 -0700

    Fix spurious UNAVAIL status is getaddrinfo
    
    (cherry picked from commit c3dfadb87e16f0fab6f4d5242bcecf06c02976c7)

diff --git a/ChangeLog b/ChangeLog
index 92ec78d..be91db9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-03-25  Andreas Schwab  <schwab@redhat.com>
 
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
+	each action.
+
+2010-03-25  Andreas Schwab  <schwab@redhat.com>
+
 	* sysdeps/posix/cuserid.c: Fix typo.
 
 2010-03-24  Ulrich Drepper  <drepper@redhat.com>
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 62c38f6..8b7e38f 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -702,6 +702,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 	  while (!no_more)
 	    {
+	      no_data = 0;
 	      nss_gethostbyname4_r fct4
 		= __nss_lookup_function (nip, "gethostbyname4_r");
 	      if (fct4 != NULL)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8469d71f1ffc0c910f69b9097fafdcf6594e108f

commit 8469d71f1ffc0c910f69b9097fafdcf6594e108f
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Mar 25 11:35:05 2010 +0100

    Fix typo in cuserid
    
    (cherry picked from commit 34b514dff6acf8f1cac0afefd24049e025fd62ea)

diff --git a/ChangeLog b/ChangeLog
index 3198695..92ec78d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-25  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/posix/cuserid.c: Fix typo.
+
 2010-03-24  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11397]
diff --git a/sysdeps/posix/cuserid.c b/sysdeps/posix/cuserid.c
index f30c20e..a74ff84 100644
--- a/sysdeps/posix/cuserid.c
+++ b/sysdeps/posix/cuserid.c
@@ -44,6 +44,6 @@ cuserid (s)
 
   if (s == NULL)
     s = name;
-  s[L_userid - 1] = '\0';
+  s[L_cuserid - 1] = '\0';
   return strncpy (s, pwptr->pw_name, L_cuserid - 1);
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f273badc6b317d8d0ba9ba52e873c98a7e72a4e7

commit f273badc6b317d8d0ba9ba52e873c98a7e72a4e7
Author: Jonathan Geisler <jgeisler@cse.taylor.edu>
Date:   Wed Mar 24 16:02:15 2010 -0700

    calls to cuserid() can result in buffer overruns and/or overflows
    
    (cherry picked from commit fd8ccb0427569ffdfbb70c8828029122f3459160)

diff --git a/ChangeLog b/ChangeLog
index eece5e9..3198695 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-24  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11397]
+	* sysdeps/posix/cuserid.c (cuserid): Make sure the returned string
+	is NUL terminated.
+	Patch by Jonathan Geisler <jgeisler@cse.taylor.edu>.
+
 2010-03-02  Richard Guenther  <rguenther@suse.de>
 
 	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): R_X86_64_PC32
diff --git a/sysdeps/posix/cuserid.c b/sysdeps/posix/cuserid.c
index 11c827a..f30c20e 100644
--- a/sysdeps/posix/cuserid.c
+++ b/sysdeps/posix/cuserid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1998, 1999, 2001, 2010 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
@@ -44,5 +44,6 @@ cuserid (s)
 
   if (s == NULL)
     s = name;
-  return strncpy (s, pwptr->pw_name, L_cuserid);
+  s[L_userid - 1] = '\0';
+  return strncpy (s, pwptr->pw_name, L_cuserid - 1);
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=877103176f621c64bdd847e2db49205de7e32e61

commit 877103176f621c64bdd847e2db49205de7e32e61
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Wed Mar 17 09:01:34 2010 -0700

    Fix missing dependency of localedata tests on gconv-modules
    
    (cherry picked from commit 234333153e5b29fec2c0b383249db6f245a877e9)

diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index e2f26de..4cb9e61 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-16  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	* Makefile: Add missing gconv-modules dependency.
+
 2010-01-25  Andreas Schwab  <schwab@redhat.com>
 
 	* locales/i18n: Don't map U00DF to U1E9E in toupper table.
diff --git a/localedata/Makefile b/localedata/Makefile
index d364001..8f356ec 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -107,6 +107,8 @@ install-others := $(addprefix $(inst_i18ndir)/, \
 			      $(addsuffix .gz, $(charmaps)) \
 			      $(locales))
 
+tests: $(objdir)/iconvdata/gconv-modules
+
 include ../Rules
 
 # Install the charmap files in gzipped format.
@@ -298,3 +300,6 @@ tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
 		LOCPATH=$(common-objpfx)localedata
 $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
+
+$(objdir)/iconvdata/gconv-modules:
+	$(MAKE) -C ../iconvdata subdir=iconvdata $@

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7dab764e6058b7383d76f0ba2b63ae3afbafd4ba

commit 7dab764e6058b7383d76f0ba2b63ae3afbafd4ba
Author: Richard Guenther <rguenther@suse.de>
Date:   Thu Mar 4 19:33:41 2010 -0800

    Fix R_X86_64_PC32 overflow detection
    
    (cherry picked from commit e39acb1f165c467e99509146c95f69c7444521e3)

diff --git a/ChangeLog b/ChangeLog
index 674587a..eece5e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-02  Richard Guenther  <rguenther@suse.de>
+
+	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): R_X86_64_PC32
+	is sign-extending.
+
 2010-02-24  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11319]
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 61a0556..f615e95 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  x86-64 version.
-   Copyright (C) 2001-2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2006, 2008, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>.
 
@@ -419,7 +419,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	case R_X86_64_PC32:
 	  value += reloc->r_addend - (Elf64_Addr) reloc_addr;
 	  *(unsigned int *) reloc_addr = value;
-	  if (__builtin_expect (value != (unsigned int) value, 0))
+	  if (__builtin_expect (value != (int) value, 0))
 	    {
 	      fmt = "\
 %s: Symbol `%s' causes overflow in R_X86_64_PC32 relocation\n";

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a82e74eb468e899f7ebe4204eefa04a967002f77

commit a82e74eb468e899f7ebe4204eefa04a967002f77
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 24 16:07:57 2010 -0800

    Fix reporting of I/O errors in *dprintf functions.
    
    (cherry picked from commit 7ca890b88e6ab7624afb1742a9fffb37ad5b3fc3)

diff --git a/ChangeLog b/ChangeLog
index e66e0c1..674587a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
 2010-02-24  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11319]
+	* libio/iovdprintf.c (_IO_vdprintf): Explicitly flush stream before
+	undoing the stream because _IO_FINISH doesn't report failures.
+
 	[BZ #5553]
 	* malloc/malloc.c (public_vALLOc): Set ar_ptr when trying main_arena.
 	(public_pVALLOc): Likewise.
+	Patch by Petr Baudis.
 
 2010-02-22  Jim Meyering  <meyering@redhat.com>
 
diff --git a/libio/iovdprintf.c b/libio/iovdprintf.c
index edab849..5284ff8 100644
--- a/libio/iovdprintf.c
+++ b/libio/iovdprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006
+/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -60,6 +60,9 @@ _IO_vdprintf (d, format, arg)
 
   done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
 
+  if (done != EOF && _IO_do_flush (&tmpfil.file) == EOF)
+    done = EOF;
+
   _IO_FINISH (&tmpfil.file);
 
   return done;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fae1e90fa13beb6b84454626df2933ecc0b30c66

commit fae1e90fa13beb6b84454626df2933ecc0b30c66
Author: Petr Baudis <pasky@suse.cz>
Date:   Wed Feb 24 15:44:29 2010 -0800

    Fix assertion in palloc and pvalloc as well.
    
    (cherry picked from commit 8c0b5f148eccd0a4d9714e72f50f13c586af59ec)

diff --git a/ChangeLog b/ChangeLog
index 6f4dfaa..e66e0c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-24  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #5553]
+	* malloc/malloc.c (public_vALLOc): Set ar_ptr when trying main_arena.
+	(public_pVALLOc): Likewise.
+
 2010-02-22  Jim Meyering  <meyering@redhat.com>
 
 	* manual/math.texi (BSD Random): Fix a typo: s/are/is/
diff --git a/malloc/malloc.c b/malloc/malloc.c
index ea10d17..f722676 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 1996-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1996-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>
    and Doug Lea <dl@cs.oswego.edu>, 2001.
@@ -3933,9 +3933,10 @@ public_vALLOc(size_t bytes)
   if(!p) {
     /* Maybe the failure is due to running out of mmapped areas. */
     if(ar_ptr != &main_arena) {
-      (void)mutex_lock(&main_arena.mutex);
-      p = _int_memalign(&main_arena, pagesz, bytes);
-      (void)mutex_unlock(&main_arena.mutex);
+      ar_ptr = &main_arena;
+      (void)mutex_lock(&ar_ptr->mutex);
+      p = _int_memalign(&ar_ptr-> pagesz, bytes);
+      (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS
       /* ... or sbrk() has failed and there is still a chance to mmap() */
@@ -3978,9 +3979,10 @@ public_pVALLOc(size_t bytes)
   if(!p) {
     /* Maybe the failure is due to running out of mmapped areas. */
     if(ar_ptr != &main_arena) {
-      (void)mutex_lock(&main_arena.mutex);
-      p = _int_memalign(&main_arena, pagesz, rounded_bytes);
-      (void)mutex_unlock(&main_arena.mutex);
+      ar_ptr = &main_arena;
+      (void)mutex_lock(&ar_ptr->mutex);
+      p = _int_memalign(&ar_ptr-> pagesz, rounded_bytes);
+      (void)mutex_unlock(&ar_ptr->mutex);
     } else {
 #if USE_ARENAS
       /* ... or sbrk() has failed and there is still a chance to mmap() */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3c0fb4080d496b788c4e579f130794574eb35e0b

commit 3c0fb4080d496b788c4e579f130794574eb35e0b
Author: Jim Meyering <meyering@redhat.com>
Date:   Wed Oct 29 11:05:39 2008 +0100

    manual: fix typo: s/are/is/
    
    * manual/math.texi (BSD Random): Fix a typo: s/are/is/
    
    (cherry picked from commit e2f4aa547a997922d960876671fb35ea101295f8)

diff --git a/ChangeLog b/ChangeLog
index 6071e56..6f4dfaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2010-02-22  Jim Meyering  <meyering@redhat.com>
 
+	* manual/math.texi (BSD Random): Fix a typo: s/are/is/
+
 	* manual/charset.texi: Adjust grammar.
 
 	* manual/errno.texi (Error Messages): Fix doubled-words and typos.
diff --git a/manual/math.texi b/manual/math.texi
index 50e087c..95e3378 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -1421,7 +1421,7 @@ pseudo-random number generator.
 
 The GNU C library contains four additional functions which contain the
 state as an explicit parameter and therefore make it possible to handle
-thread-local PRNGs.  Beside this there are no difference.  In fact, the
+thread-local PRNGs.  Beside this there is no difference.  In fact, the
 four functions already discussed are implemented internally using the
 following interfaces.
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2da4488386833b4787fc3e364a304bf2201b0aca

commit 2da4488386833b4787fc3e364a304bf2201b0aca
Author: Jim Meyering <meyering@redhat.com>
Date:   Wed Jun 4 11:46:50 2008 +0200

    manual: adjust grammar
    
    * manual/charset.texi: Adjust grammar.
    
    (cherry picked from commit 82acaacb9c7689c479c3426743ae66d0ad466a1d)

diff --git a/ChangeLog b/ChangeLog
index c86bd63..6071e56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2010-02-22  Jim Meyering  <meyering@redhat.com>
 
+	* manual/charset.texi: Adjust grammar.
+
 	* manual/errno.texi (Error Messages): Fix doubled-words and typos.
 	* manual/charset.texi (Selecting the Conversion): Likewise.
 	* manual/getopt.texi (Getopt Long Options): Likewise.
diff --git a/manual/charset.texi b/manual/charset.texi
index a49798c..808469b 100644
--- a/manual/charset.texi
+++ b/manual/charset.texi
@@ -393,7 +393,7 @@ We already said above that the currently selected locale for the
 by the functions we are about to describe.  Each locale uses its own
 character set (given as an argument to @code{localedef}) and this is the
 one assumed as the external multibyte encoding.  The wide character
-set always is UCS-4, at least on GNU systems.
+set is always UCS-4, at least on GNU systems.
 
 A characteristic of each multibyte character set is the maximum number
 of bytes that can be necessary to represent one character.  This
@@ -577,8 +577,8 @@ The @code{btowc} function was introduced in @w{Amendment 1} to @w{ISO C90}
 and is declared in @file{wchar.h}.
 @end deftypefun
 
-Despite the limitation that the single byte value always is interpreted
-in the initial state this function is actually useful most of the time.
+Despite the limitation that the single byte value is always interpreted
+in the initial state, this function is actually useful most of the time.
 Most characters are either entirely single-byte character sets or they
 are extension to ASCII.  But then it is possible to write code like this
 (not that this specific example is very useful):
@@ -607,10 +607,10 @@ that there is no guarantee that one can perform this kind of arithmetic
 on the character of the character set used for @code{wchar_t}
 representation.  In other situations the bytes are not constant at
 compile time and so the compiler cannot do the work.  In situations like
-this it is necessary @code{btowc}.
+this, using @code{btowc} is required.
 
 @noindent
-There also is a function for the conversion in the other direction.
+There is also a function for the conversion in the other direction.
 
 @comment wchar.h
 @comment ISO

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a4b67d9bcd17d19386fada0c26f2dbbf0f192d9f

commit a4b67d9bcd17d19386fada0c26f2dbbf0f192d9f
Author: Jim Meyering <meyering@redhat.com>
Date:   Wed May 28 11:37:21 2008 +0200

    manual: fix doubled-words and typos
    
    * manual/charset.texi (Selecting the Conversion): Likewise.
    * manual/errno.texi (Error Messages): Likewise.
    * manual/getopt.texi (Getopt Long Options): Likewise.
    * manual/memory.texi (Resizing the Data Segment): Likewise.
    * manual/message.texi (GUI program problems): Likewise.
    * manual/resource.texi (CPU Affinity): Likewise.
    * manual/stdio.texi (Streams and Threads): Likewise.
    * manual/time.texi (High Accuracy Clock): Likewise.
    
    (cherry picked from commit bbf70ae9ce646540576f2b0cbc66b90da1511b0b)

diff --git a/ChangeLog b/ChangeLog
index 0fa8446..c86bd63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-22  Jim Meyering  <meyering@redhat.com>
+
+	* manual/errno.texi (Error Messages): Fix doubled-words and typos.
+	* manual/charset.texi (Selecting the Conversion): Likewise.
+	* manual/getopt.texi (Getopt Long Options): Likewise.
+	* manual/memory.texi (Resizing the Data Segment): Likewise.
+	* manual/message.texi (GUI program problems): Likewise.
+	* manual/resource.texi (CPU Affinity): Likewise.
+	* manual/stdio.texi (Streams and Threads): Likewise.
+	* manual/time.texi (High Accuracy Clock): Likewise.
+
 2010-02-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
 	* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
diff --git a/manual/charset.texi b/manual/charset.texi
index 79854e5..a49798c 100644
--- a/manual/charset.texi
+++ b/manual/charset.texi
@@ -393,7 +393,7 @@ We already said above that the currently selected locale for the
 by the functions we are about to describe.  Each locale uses its own
 character set (given as an argument to @code{localedef}) and this is the
 one assumed as the external multibyte encoding.  The wide character
-character set always is UCS-4, at least on GNU systems.
+set always is UCS-4, at least on GNU systems.
 
 A characteristic of each multibyte character set is the maximum number
 of bytes that can be necessary to represent one character.  This
diff --git a/manual/errno.texi b/manual/errno.texi
index fcba267..253e7b0 100644
--- a/manual/errno.texi
+++ b/manual/errno.texi
@@ -1419,7 +1419,7 @@ available on all systems implementing @w{ISO C}.  But often the text
 @code{perror} generates is not what is wanted and there is no way to
 extend or change what @code{perror} does.  The GNU coding standard, for
 instance, requires error messages to be preceded by the program name and
-programs which read some input files should should provide information
+programs which read some input files should provide information
 about the input file name and the line number in case an error is
 encountered while reading the file.  For these occasions there are two
 functions available which are widely used throughout the GNU project.
diff --git a/manual/getopt.texi b/manual/getopt.texi
index 8c9bd20..7704515 100644
--- a/manual/getopt.texi
+++ b/manual/getopt.texi
@@ -269,7 +269,7 @@ When @code{getopt_long} has no more options to handle, it returns
 @var{argv} of the next remaining argument.
 @end deftypefun
 
-Since long option names were used before before the @code{getopt_long}
+Since long option names were used before the @code{getopt_long}
 options was invented there are program interfaces which require programs
 to recognize options like @w{@samp{-option value}} instead of
 @w{@samp{--option value}}.  To enable these programs to use the GNU
diff --git a/manual/memory.texi b/manual/memory.texi
index 43afc7b..59ea1ee 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -2379,7 +2379,7 @@ exceed the process' data storage limit.
 @c The Brk system call in Linux (as opposed to the GNU C Library function)
 @c is considerably different.  It always returns the new end of the data
 @c segment, whether it succeeds or fails.  The GNU C library Brk determines
-@c it's a failure if and only if if the system call returns an address less
+@c it's a failure if and only if the system call returns an address less
 @c than the address requested.
 
 @end deftypefun
diff --git a/manual/message.texi b/manual/message.texi
index e772b2d..e44545a 100644
--- a/manual/message.texi
+++ b/manual/message.texi
@@ -1466,7 +1466,7 @@ have this problem.  But there is a very simple and powerful method to
 handle these kind of problems with the @code{gettext} functions.
 
 @noindent
-As as example consider the following fictional situation.  A GUI program
+As an example consider the following fictional situation.  A GUI program
 has a menu bar with the following entries:
 
 @smallexample
diff --git a/manual/resource.texi b/manual/resource.texi
index 4a814c9..0549572 100644
--- a/manual/resource.texi
+++ b/manual/resource.texi
@@ -1288,7 +1288,7 @@ protected from concurrent accesses from different processors.
 The POSIX standard up to this date is of not much help to solve this
 problem.  The Linux kernel provides a set of interfaces to allow
 specifying @emph{affinity sets} for a process.  The scheduler will
-schedule the thread or process on on CPUs specified by the affinity
+schedule the thread or process on CPUs specified by the affinity
 masks.  The interfaces which the GNU C library define follow to some
 extend the Linux kernel interface.
 
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 6748513..9fb209a 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -574,7 +574,7 @@ operation itself is avoided.  More importantly, functions like
 introduction of threads) were implemented as macros which are very fast
 if the buffer is not empty.  With the addition of locking requirements
 these functions are no longer implemented as macros since they would
-would expand to too much code.
+expand to too much code.
 But these macros are still available with the same functionality under the new
 names @code{putc_unlocked} and @code{getc_unlocked}.  This possibly huge
 difference of speed also suggests the use of the @code{_unlocked}
diff --git a/manual/time.texi b/manual/time.texi
index 393bccd..f1f4254 100644
--- a/manual/time.texi
+++ b/manual/time.texi
@@ -972,7 +972,7 @@ This counter represents the number of calibration errors (caused by
 large offsets or jitter).
 
 @item long int stbcnt
-This counter denotes the number of of calibrations where the stability
+This counter denotes the number of calibrations where the stability
 exceeded the threshold.
 @end table
 @end deftp

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f514e0b22795750f91eea596d5cba1845680dbe0

commit f514e0b22795750f91eea596d5cba1845680dbe0
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Date:   Thu Feb 11 07:22:58 2010 -0800

    S/390: Disable two UTF conversion instructions
    
    (cherry picked from commit a3dc465852c38ffb4f329ca8b5b477a3c314c1ef)

diff --git a/ChangeLog b/ChangeLog
index 6a0f4c0..0fa8446 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
+	instructions cu21 and cu24.  Add well-formedness checking
+	parameter and adjust the software implementation.
+	* sysdeps/s390/s390-64/utf16-utf32-z9.c: Likewise.
+
 2010-02-10  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11271]
diff --git a/sysdeps/s390/s390-64/utf16-utf32-z9.c b/sysdeps/s390/s390-64/utf16-utf32-z9.c
index 868dea6..14daf21 100644
--- a/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ b/sysdeps/s390/s390-64/utf16-utf32-z9.c
@@ -203,7 +203,10 @@ gconv_end (struct __gconv_step *data)
    swapping).  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
       {									\
 	HARDWARE_CONVERT ("cu24 %0, %1, 1");				\
 	if (inptr != inend)						\
@@ -229,6 +232,12 @@ gconv_end (struct __gconv_step *data)
       }									\
     else								\
       {									\
+        /* An isolated low-surrogate was found.  This has to be         \
+	   considered ill-formed.  */					\
+        if (__builtin_expect (u1 >= 0xdc00, 0))				\
+	  {								\
+	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				\
+	  }								\
 	/* It's a surrogate character.  At least the first word says	\
 	   it is.  */							\
 	if (__builtin_expect (inptr + 4 > inend, 0))			\
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
index 531d3eb..5f73f3c 100644
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -345,9 +345,12 @@ gconv_end (struct __gconv_step *data)
    Operation.  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
       {									\
-	HARDWARE_CONVERT ("cu21 %0, %1");				\
+	HARDWARE_CONVERT ("cu21 %0, %1, 1");				\
 	if (inptr != inend)						\
 	  {								\
 	    /* Check if the third byte is				\
@@ -388,7 +391,7 @@ gconv_end (struct __gconv_step *data)
 									\
 	outptr += 2;							\
       }									\
-    else if (c >= 0x0800 && c <= 0xd7ff)				\
+    else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff)		\
       {									\
 	/* Three byte UTF-8 char.  */					\
 									\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=69ad8afe74aa5a0aa727553e010ad0dded7721dd

commit 69ad8afe74aa5a0aa727553e010ad0dded7721dd
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 10 20:31:48 2010 -0800

    Fix file descriotor leak in nftw with FTW_CHDIR
    
    (cherry picked from commit 247fdf2e2b798378d8aeaac1ee6f4ba0a49f31f3)

diff --git a/ChangeLog b/ChangeLog
index a63f1b9..6a0f4c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-10  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11271]
+	* io/ftw.c (ftw_startup): Close	descriptor for initial directory
+	after changing back to it.
+
 2010-02-09  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/i386/lshift.S: Fix unwind information.
diff --git a/io/ftw.c b/io/ftw.c
index 9cc0907..bb7dba8 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -1,5 +1,5 @@
 /* File tree walker functions.
-   Copyright (C) 1996-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -790,6 +790,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
     {
       int save_err = errno;
       __fchdir (cwdfd);
+      close_not_cancel_no_status (cwdfd);
       __set_errno (save_err);
     }
   else if (cwd != NULL)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c648b3046e619146357f706a1d0ccced601e039f

commit c648b3046e619146357f706a1d0ccced601e039f
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Feb 9 22:54:36 2010 -0800

    Fix i386 __mpn_lshift unwind info
    
    (cherry picked from commit 1d7223f31af8c35053e7a6fbac3070bcaa7bf87d)

diff --git a/ChangeLog b/ChangeLog
index b9f7357..a63f1b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-09  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/i386/lshift.S: Fix unwind information.
+
 2010-02-03  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11242]
diff --git a/sysdeps/i386/lshift.S b/sysdeps/i386/lshift.S
index 536d987..398cf03 100644
--- a/sysdeps/i386/lshift.S
+++ b/sysdeps/i386/lshift.S
@@ -1,5 +1,5 @@
 /* i80386 __mpn_lshift --
-   Copyright (C) 1992, 1994, 1997-2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1992,1994,1997-2000,2005,2010 Free Software Foundation, Inc.
    This file is part of the GNU MP Library.
 
    The GNU MP Library is free software; you can redistribute it and/or modify
@@ -55,6 +55,7 @@ ENTRY (BP_SYM (__mpn_lshift))
 
 	movl	(%esi,%edx,4),%ebx	/* read most significant limb */
 	cfi_rel_offset (ebx, 0)
+	cfi_remember_state
 	xorl	%eax,%eax
 	shldl	%cl,%ebx,%eax		/* compute carry limb */
 	decl	%edx
@@ -95,6 +96,7 @@ L(1):	movl	(%esi,%edx,4),%eax
 	LEAVE
 	ret
 
+	cfi_restore_state
 L(end):	shll	%cl,%ebx		/* compute least significant limb */
 	movl	%ebx,(%edi)		/* store it */
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b204d65517276f8cdaf3a83349d0f1f553da68a2

commit b204d65517276f8cdaf3a83349d0f1f553da68a2
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 3 06:23:31 2010 -0800

    Fix endless loop with invalid /etc/shells file.
    
    (cherry picked from commit caa6e77293d85e31dfde371b78862e9330a1478e)

diff --git a/ChangeLog b/ChangeLog
index 47f2e52..b9f7357 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-03  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11242]
+	* misc/getusershell.c (initshells): Allocate one more byte in input
+	buffer so that fgets doesn't loop undefinitely.
+
 2010-01-25  Andreas Schwab  <schwab@redhat.com>
 
 	* iconv/iconv_prog.c (write_output): Fix check for open failure.
diff --git a/misc/getusershell.c b/misc/getusershell.c
index 636da32..0e4f796 100644
--- a/misc/getusershell.c
+++ b/misc/getusershell.c
@@ -116,7 +116,8 @@ initshells()
 	}
 	if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
 		goto init_okshells;
-	if ((strings = malloc(statb.st_size + 2)) == NULL)
+	flen = statb.st_size + 3;
+	if ((strings = malloc(flen)) == NULL)
 		goto init_okshells;
 	shells = malloc(statb.st_size / 3 * sizeof (char *));
 	if (shells == NULL) {
@@ -126,7 +127,6 @@ initshells()
 	}
 	sp = shells;
 	cp = strings;
-	flen = statb.st_size + 2;
 	while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
 		while (*cp != '#' && *cp != '/' && *cp != '\0')
 			cp++;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=272eb2b141c22d03c1c68050b4ad97b2a0adfc69

commit 272eb2b141c22d03c1c68050b4ad97b2a0adfc69
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Jan 25 12:01:42 2010 -0800

    Don't map U00DF to U1E9E in toupper table.
    
    (cherry picked from commit 1112095740b82eeaea36d2567ea98c6745ef1d13)

diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index 8828426..e2f26de 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-25  Andreas Schwab  <schwab@redhat.com>
+
+	* locales/i18n: Don't map U00DF to U1E9E in toupper table.
+
 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
 
 	* locales/hsb_DE: Define week, first_weekday, and first_workday.
diff --git a/localedata/locales/i18n b/localedata/locales/i18n
index 8afbb71..4f8b9e1 100644
--- a/localedata/locales/i18n
+++ b/localedata/locales/i18n
@@ -928,8 +928,7 @@ toupper /
    (<U006D>,<U004D>);(<U006E>,<U004E>);(<U006F>,<U004F>);(<U0070>,<U0050>);/
    (<U0071>,<U0051>);(<U0072>,<U0052>);(<U0073>,<U0053>);(<U0074>,<U0054>);/
    (<U0075>,<U0055>);(<U0076>,<U0056>);(<U0077>,<U0057>);(<U0078>,<U0058>);/
-   (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00DF>,<U1E9E>);/
-   (<U00E0>,<U00C0>);/
+   (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00E0>,<U00C0>);/
    (<U00E1>,<U00C1>);(<U00E2>,<U00C2>);(<U00E3>,<U00C3>);(<U00E4>,<U00C4>);/
    (<U00E5>,<U00C5>);(<U00E6>,<U00C6>);(<U00E7>,<U00C7>);(<U00E8>,<U00C8>);/
    (<U00E9>,<U00C9>);(<U00EA>,<U00CA>);(<U00EB>,<U00CB>);(<U00EC>,<U00CC>);/

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4aa960e79da30982273b3e572e488c1de635cf53

commit 4aa960e79da30982273b3e572e488c1de635cf53
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Jan 25 07:17:47 2010 -0800

    Fix error checking in iconv.
    
    (cherry picked from commit 7a518360023592882a7335b843ce1a5ea322dec5)

diff --git a/ChangeLog b/ChangeLog
index cea6315..47f2e52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-25  Andreas Schwab  <schwab@redhat.com>
+
+	* iconv/iconv_prog.c (write_output): Fix check for open failure.
+
 2010-01-22  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11200]
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index a1ca05f..3bcb9b4 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -442,7 +442,7 @@ write_output (const char *outbuf, const char *outptr, FILE **output,
       if (output_file != NULL && strcmp (output_file, "-") != 0)
 	{
 	  *output = fopen (output_file, "w");
-	  if (output == NULL)
+	  if (*output == NULL)
 	    error (EXIT_FAILURE, errno, _("cannot open output file"));
 	}
       else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2ce2bf1a9845ad1e0c5c3fa0bdd3601d95a78c45

commit 2ce2bf1a9845ad1e0c5c3fa0bdd3601d95a78c45
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jan 22 12:45:43 2010 -0800

    Add BZ number.
    
    (cherry picked from commit 8549abcb9ca4d7857cc457aaa17c2073522804f4)

diff --git a/ChangeLog b/ChangeLog
index a9e21bf..cea6315 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-01-22  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11200]
 	* locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine
 	mmap resource problem.  Patch by Joe Landers <jlanders@vmware.com>.
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=721d1acb10d336ad53dfefff8a515e3c1f2e3791

commit 721d1acb10d336ad53dfefff8a515e3c1f2e3791
Author: Joe Landers <jlanders@vmware.com>
Date:   Fri Jan 22 12:44:58 2010 -0800

    _nl_load_locale() incorrectly handles mmap() failures
    
    (cherry picked from commit 8b2f25c23374fe79645499b8095f0d2f6eb24f71)

diff --git a/ChangeLog b/ChangeLog
index 4f77732..a9e21bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-22  Ulrich Drepper  <drepper@redhat.com>
+
+	* locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine
+	mmap resource problem.  Patch by Joe Landers <jlanders@vmware.com>.
+
 2010-01-22  Jim Meyering  <jim@meyering.net>
 
 	[BZ #11184]
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 467dff1..b91941e 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -224,6 +224,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
 		     PROT_READ, MAP_FILE|MAP_COPY, fd, 0);
   if (__builtin_expect (filedata == MAP_FAILED, 0))
     {
+      filedata = NULL;
       if (__builtin_expect (errno, ENOSYS) == ENOSYS)
 	{
 #endif	/* _POSIX_MAPPED_FILES */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ea8e535ed1178b121e3ad5a5b2ebfd24a3bcf27b

commit ea8e535ed1178b121e3ad5a5b2ebfd24a3bcf27b
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jan 22 09:48:35 2010 -0800

    Extend overflow detection in re_dfa_add_node.
    
    (cherry picked from commit 22364644882b6cf426ed13be5b6480c3a9210eb1)

diff --git a/ChangeLog b/ChangeLog
index 7bd7e8b..4f77732 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-01-22  Jim Meyering  <jim@meyering.net>
 
+	[BZ #11184]
+	* posix/regex_internal.c (re_dfa_add_node): Extend the overflow
+	detection test.  Patch by Paul Eggert.
+
+	[BZ #11183]
 	* posix/regex_internal.c (re_string_realloc_buffers):
 	Detect and handle internal overflow.  Patch by Paul Eggert
 
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index fec3123..09cffcf 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -1411,8 +1411,11 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
       re_node_set *new_edests, *new_eclosures;
       re_token_t *new_nodes;
 
-      /* Avoid overflows.  */
-      if (BE (new_nodes_alloc < dfa->nodes_alloc, 0))
+      /* Avoid overflows in realloc.  */
+      const size_t max_object_size = MAX (sizeof (re_token_t),
+					  MAX (sizeof (re_node_set),
+					       sizeof (int)));
+      if (BE (SIZE_MAX / max_object_size < new_nodes_alloc, 0))
 	return -1;
 
       new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5238213a22c9e64eff78e1eda1763c6c4bf52bcd

commit 5238213a22c9e64eff78e1eda1763c6c4bf52bcd
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jan 22 09:33:01 2010 -0800

    regex: avoid internal re_realloc overflow
    
    (cherry picked from commit 54dd0ab31fe2b2168ba1a6180a0c05941fb54b3c)

diff --git a/ChangeLog b/ChangeLog
index 44deae5..7bd7e8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-22  Jim Meyering  <jim@meyering.net>
+
+	* posix/regex_internal.c (re_string_realloc_buffers):
+	Detect and handle internal overflow.  Patch by Paul Eggert
+
 2010-01-20  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index c9da2b9..fec3123 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -133,7 +133,14 @@ re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
 #ifdef RE_ENABLE_I18N
   if (pstr->mb_cur_max > 1)
     {
-      wint_t *new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
+      wint_t *new_wcs;
+
+      /* Avoid overflow in realloc.  */
+      const size_t max_object_size = MAX (sizeof (wint_t), sizeof (int));
+      if (BE (SIZE_MAX / max_object_size < new_buf_len, 0))
+	return REG_ESPACE;
+
+      new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
       if (BE (new_wcs == NULL, 0))
 	return REG_ESPACE;
       pstr->wcs = new_wcs;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b95387484e410a20334919b250f1614be468e41c

commit b95387484e410a20334919b250f1614be468e41c
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Jan 20 07:59:30 2010 -0800

    Fix ____longjmp_chk for s390/s390x.
    
    (cherry picked from commit e3b7670be21d6992e3ca9ee1ad3a5d08eb3a24c9)

diff --git a/ChangeLog b/ChangeLog
index ba93d2f..44deae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-20  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+	(CHECK_SP): Fix check for alternate stack.
+	* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+	(CHECK_SP): Likewise.
+
 2010-01-19  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11194]
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
index b28e587..f2c1518 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
index dcf58fb..261be25 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b0e8ad9e4b224d9b45def4efbc66618361f18448

commit b0e8ad9e4b224d9b45def4efbc66618361f18448
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Jan 19 12:04:34 2010 -0800

    Remove unnecessary returns.
    
    (cherry picked from commit a7bbf3d742b181bdad41e830f6ef72e632e9fc89)

diff --git a/ChangeLog b/ChangeLog
index a45e8ee..ba93d2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-19  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11194]
+	* misc/bits/syslog.h (syslog, vsyslog): Remove unnecessary return.
+
 2010-01-18  Andreas Schwab  <schwab@redhat.com>
 
 	* elf/dynamic-link.h (elf_get_dynamic_info): Use correct type when
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index 853b30c..5d64d7a 100644
--- a/misc/bits/syslog.h
+++ b/misc/bits/syslog.h
@@ -1,5 +1,5 @@
 /* Checking macros for syslog functions.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2010 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
@@ -29,7 +29,7 @@ extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
 __extern_always_inline void
 syslog (int __pri, __const char *__fmt, ...)
 {
-  return __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+  __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
 }
 #elif !defined __cplusplus
 # define syslog(pri, ...) \
@@ -45,6 +45,6 @@ extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
 __extern_always_inline void
 vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
 {
-  return __vsyslog_chk (__pri,  __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+  __vsyslog_chk (__pri,  __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
 }
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=72fe1ad1520b87137b11c315533594a4e350adea

commit 72fe1ad1520b87137b11c315533594a4e350adea
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Jan 18 07:24:09 2010 -0800

    Use correct type when casting d_tag.
    
    (cherry picked from commit db07e962b6ea963dbb345439f6ab9b0cf74d87c5)

diff --git a/ChangeLog b/ChangeLog
index 6f61651..a45e8ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-01-18  Andreas Schwab  <schwab@redhat.com>
 
+	* elf/dynamic-link.h (elf_get_dynamic_info): Use correct type when
+	casting d_tag.
+
 	* elf/dynamic-link.h (elf_get_dynamic_info): Ignore negative
 	dynamic entry types.
 
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index dff0655..6d7e142 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -103,6 +103,11 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 {
   ElfW(Dyn) *dyn = l->l_ld;
   ElfW(Dyn) **info;
+#if __ELF_NATIVE_CLASS == 32
+  typedef Elf32_Word d_tag_utype;
+#elif __ELF_NATIVE_CLASS == 64
+  typedef Elf64_Xword d_tag_utype;
+#endif
 
 #ifndef RTLD_BOOTSTRAP
   if (dyn == NULL)
@@ -113,20 +118,20 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 
   while (dyn->d_tag != DT_NULL)
     {
-      if ((Elf32_Word) dyn->d_tag < DT_NUM)
+      if ((d_tag_utype) dyn->d_tag < DT_NUM)
 	info[dyn->d_tag] = dyn;
       else if (dyn->d_tag >= DT_LOPROC &&
 	       dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
 	info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
-      else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
+      else if ((d_tag_utype) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
 	info[VERSYMIDX (dyn->d_tag)] = dyn;
-      else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
+      else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
 	info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM] = dyn;
-      else if ((Elf32_Word) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
+      else if ((d_tag_utype) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
 	info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
-      else if ((Elf32_Word) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
+      else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
 	info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
 	     + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
       ++dyn;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e73ad37f1571c67eaa0ea503ae91412f1d7abc6d

commit e73ad37f1571c67eaa0ea503ae91412f1d7abc6d
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Jan 18 07:23:23 2010 -0800

    Ignore negative dynamic entry types.
    
    (cherry picked from commit 7a033a828df19b4f3bfd7e4d66102f63d1167f08)

diff --git a/ChangeLog b/ChangeLog
index 155a9a1..6f61651 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-18  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dynamic-link.h (elf_get_dynamic_info): Ignore negative
+	dynamic entry types.
+
 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
 
 	* bits/confname.h: Make pre-C99-safe.
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index c34cbcd..dff0655 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -113,7 +113,7 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
 
   while (dyn->d_tag != DT_NULL)
     {
-      if (dyn->d_tag < DT_NUM)
+      if ((Elf32_Word) dyn->d_tag < DT_NUM)
 	info[dyn->d_tag] = dyn;
       else if (dyn->d_tag >= DT_LOPROC &&
 	       dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8c55b16c2f2c1fcbfe83916b598ed8c42a70350d

commit 8c55b16c2f2c1fcbfe83916b598ed8c42a70350d
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Jan 14 17:03:42 2010 -0800

    Make unistd.h pre-c((-safe.
    
    (cherry picked from commit 0b689682ad2705f57177f12158479036fcbf9563)

diff --git a/ChangeLog b/ChangeLog
index 3158003..155a9a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-14  Ulrich Drepper  <drepper@redhat.com>
+
+	* bits/confname.h: Make pre-C99-safe.
+
 2010-02-05  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #11230]
diff --git a/bits/confname.h b/bits/confname.h
index 757ed4f..085c385 100644
--- a/bits/confname.h
+++ b/bits/confname.h
@@ -527,7 +527,7 @@ enum
 
     _SC_THREAD_ROBUST_PRIO_INHERIT,
 #define _SC_THREAD_ROBUST_PRIO_INHERIT	_SC_THREAD_ROBUST_PRIO_INHERIT
-    _SC_THREAD_ROBUST_PRIO_PROTECT,
+    _SC_THREAD_ROBUST_PRIO_PROTECT
 #define _SC_THREAD_ROBUST_PRIO_PROTECT	_SC_THREAD_ROBUST_PRIO_PROTECT
   };
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  262 ++++++++++++++++++++
 argp/Makefile                                      |    5 +-
 argp/argp-parse.c                                  |   12 +-
 argp/bug-argp2.c                                   |   55 ++++
 bits/confname.h                                    |    2 +-
 crypt/crypt_util.c                                 |   98 ++++----
 csu/Makefile                                       |   15 +-
 elf/chroot_canon.c                                 |   10 +-
 elf/dl-version.c                                   |   12 +-
 elf/dynamic-link.h                                 |   15 +-
 elf/ldconfig.c                                     |   38 +++-
 hurd/lookup-at.c                                   |    4 +-
 iconv/iconv_prog.c                                 |    2 +-
 io/ftw.c                                           |    3 +-
 libio/iovdprintf.c                                 |    5 +-
 locale/loadlocale.c                                |    1 +
 localedata/ChangeLog                               |    8 +
 localedata/Makefile                                |    5 +
 localedata/locales/i18n                            |    3 +-
 malloc/malloc.c                                    |   19 +-
 manual/charset.texi                                |   10 +-
 manual/errno.texi                                  |    2 +-
 manual/getopt.texi                                 |    2 +-
 manual/math.texi                                   |    2 +-
 manual/memory.texi                                 |    2 +-
 manual/message.texi                                |    2 +-
 manual/resource.texi                               |    2 +-
 manual/stdio.texi                                  |    2 +-
 manual/time.texi                                   |    2 +-
 misc/bits/syslog.h                                 |    6 +-
 misc/getusershell.c                                |    4 +-
 misc/mntent_r.c                                    |    6 +-
 nscd/aicache.c                                     |   10 +-
 posix/gai.conf                                     |    9 +
 posix/getopt.c                                     |   40 ++--
 posix/regex_internal.c                             |   16 +-
 posix/regexec.c                                    |    2 +-
 resolv/netdb.h                                     |   24 ++
 resolv/nss_dns/dns-host.c                          |   34 +--
 sysdeps/i386/lshift.S                              |    4 +-
 sysdeps/mach/hurd/ttyname_r.c                      |    6 +-
 sysdeps/posix/cuserid.c                            |    5 +-
 sysdeps/posix/getaddrinfo.c                        |    1 +
 sysdeps/s390/s390-64/utf16-utf32-z9.c              |   11 +-
 sysdeps/s390/s390-64/utf8-utf16-z9.c               |    9 +-
 sysdeps/unix/bsd/ptsname.c                         |   11 +-
 sysdeps/unix/getlogin.c                            |    9 +-
 sysdeps/unix/readdir_r.c                           |   14 +-
 sysdeps/unix/sysv/linux/i386/fallocate.c           |    8 +-
 sysdeps/unix/sysv/linux/i386/fallocate64.c         |    8 +-
 sysdeps/unix/sysv/linux/i386/readdir64_r.c         |    3 +-
 sysdeps/unix/sysv/linux/ifaddrs.c                  |   55 ++++-
 .../unix/sysv/linux/s390/s390-32/____longjmp_chk.c |    2 +-
 .../unix/sysv/linux/s390/s390-64/____longjmp_chk.c |    2 +-
 sysdeps/x86_64/dl-machine.h                        |    4 +-
 sysdeps/x86_64/multiarch/init-arch.c               |   33 ++-
 sysdeps/x86_64/multiarch/init-arch.h               |    4 +-
 57 files changed, 726 insertions(+), 214 deletions(-)
 create mode 100644 argp/bug-argp2.c


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list