Author: aurel32
Date: 2010-02-07 16:43:28 +0000 (Sun, 07 Feb 2010)
New Revision: 4150

Added:
   glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-futimens.diff
   
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc_info-init.diff
   
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-resolv-bindv6only.diff
   glibc-package/branches/eglibc-2.11/debian/patches/any/local-ntp-update.diff
   
glibc-package/branches/eglibc-2.11/debian/patches/any/submitted-nis-shadow.diff
Removed:
   glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc-check.diff
Modified:
   glibc-package/branches/eglibc-2.11/debian/changelog
   
glibc-package/branches/eglibc-2.11/debian/patches/any/local-no-SOCK_NONBLOCK.diff
   glibc-package/branches/eglibc-2.11/debian/patches/series
Log:
Fix some more merge issues


Modified: glibc-package/branches/eglibc-2.11/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.11/debian/changelog 2010-02-07 15:53:49 UTC 
(rev 4149)
+++ glibc-package/branches/eglibc-2.11/debian/changelog 2010-02-07 16:43:28 UTC 
(rev 4150)
@@ -10,7 +10,12 @@
     - Remove debian/patches/alpha/submitted-procfs_h.diff (merged)
     - Remove debian/patches/any/cvs-broken-dns.diff (merged)
     - Remove debian/patches/any/cvs-getutmpx-compat.diff (merged)
+    - Remove debian/patches/any/cvs-malloc_info-output.diff (merged)
     - Remove debian/patches/any/cvs-nptl-init.diff (merged)
+    - Remove debian/patches/any/cvs-resolv-edns0.diff (merged)
+    - Remove debian/patches/any/cvs-resolv-init.diff (merged)
+    - Remove debian/patches/any/cvs-resolv-uninitialized.diff (merged)
+    - Remove debian/patches/any/cvs-resolv-v6mapped.diff (merged)
     - Remove debian/patches/any/local-dynamic-resolvconf.diff (merged)
     - Update debian/patches/any/local-libgcc-compat-main.diff
     - Remove debian/patches/any/submitted-getent-gshadow.diff (merged)
@@ -32,7 +37,6 @@
     - testsuite-checking/expected-results-ia64-linux-gnu-libc: update
     - Update debian/patches/localedata/tailor-iso14651_t1.diff
     - Add debian/patches/localedata/locale-hsb_DE.diff
-    - Update debian/patches/localedata/first_weekday.diff
     - Update testsuite-checking/expected-results-sparc-linux-gnu-libc
     - Update testsuite-checking/expected-results-sparcv9b-linux-gnu-sparcv9b
     - Remove debian/patches/any/cvs-nis-not-configured.diff (merged)

Added: glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-futimens.diff
===================================================================
--- glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-futimens.diff     
                        (rev 0)
+++ glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-futimens.diff     
2010-02-07 16:43:28 UTC (rev 4150)
@@ -0,0 +1,18 @@
+2009-12-21  Ulrich Drepper  <drep...@redhat.com>
+
+       * sysdeps/unix/sysv/linux/futimens.c: Handle AT_FDCWD.
+
+--- a/sysdeps/unix/sysv/linux/futimens.c
++++ b/sysdeps/unix/sysv/linux/futimens.c
+@@ -33,6 +33,11 @@ int
+ futimens (int fd, const struct timespec tsp[2])
+ {
+ #ifdef __NR_utimensat
++  if (fd < 0)
++    {
++      __set_errno (EBADF);
++      return -1;
++    }
+   return INLINE_SYSCALL (utimensat, 4, fd, NULL, tsp, 0);
+ #else
+   __set_errno (ENOSYS);

Deleted: 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc-check.diff
===================================================================
--- glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc-check.diff 
2010-02-07 15:53:49 UTC (rev 4149)
+++ glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc-check.diff 
2010-02-07 16:43:28 UTC (rev 4150)
@@ -1,113 +0,0 @@
-2009-11-01  Ulrich Drepper  <drep...@redhat.com>
-
-       * malloc/hooks.c (free_check): Restore locking and call _int_free
-       appropriately.
-
-diff --git a/malloc/hooks.c b/malloc/hooks.c
-index 622a815..28845ee 100644
---- a/malloc/hooks.c
-+++ b/malloc/hooks.c
-@@ -162,8 +162,8 @@ mem2chunk_check(mem, magic_p) Void_t* mem; unsigned char 
**magic_p;
-        ((char*)p + sz)>=(mp_.sbrk_base+main_arena.system_mem) )) ||
-        sz<MINSIZE || sz&MALLOC_ALIGN_MASK || !inuse(p) ||
-        ( !prev_inuse(p) && (p->prev_size&MALLOC_ALIGN_MASK ||
--                            (contig && (char*)prev_chunk(p)<mp_.sbrk_base) ||
--                            next_chunk(prev_chunk(p))!=p) ))
-+                          (contig && (char*)prev_chunk(p)<mp_.sbrk_base) ||
-+                          next_chunk(prev_chunk(p))!=p) ))
-       return NULL;
-     magic = MAGICBYTE(p);
-     for(sz += SIZE_SZ-1; (c = ((unsigned char*)p)[sz]) != magic; sz -= c) {
-@@ -177,9 +177,9 @@ mem2chunk_check(mem, magic_p) Void_t* mem; unsigned char 
**magic_p;
-        first. */
-     offset = (unsigned long)mem & page_mask;
-     if((offset!=MALLOC_ALIGNMENT && offset!=0 && offset!=0x10 &&
--        offset!=0x20 && offset!=0x40 && offset!=0x80 && offset!=0x100 &&
--        offset!=0x200 && offset!=0x400 && offset!=0x800 && offset!=0x1000 &&
--        offset<0x2000) ||
-+      offset!=0x20 && offset!=0x40 && offset!=0x80 && offset!=0x100 &&
-+      offset!=0x200 && offset!=0x400 && offset!=0x800 && offset!=0x1000 &&
-+      offset<0x2000) ||
-        !chunk_is_mmapped(p) || (p->size & PREV_INUSE) ||
-        ( (((unsigned long)p - p->prev_size) & page_mask) != 0 ) ||
-        ( (sz = chunksize(p)), ((p->prev_size + sz) & page_mask) != 0 ) )
-@@ -276,13 +276,17 @@ free_check(mem, caller) Void_t* mem; const Void_t 
*caller;
-   mchunkptr p;
- 
-   if(!mem) return;
-+  (void)mutex_lock(&main_arena.mutex);
-   p = mem2chunk_check(mem, NULL);
-   if(!p) {
-+    (void)mutex_unlock(&main_arena.mutex);
-+
-     malloc_printerr(check_action, "free(): invalid pointer", mem);
-     return;
-   }
- #if HAVE_MMAP
-   if (chunk_is_mmapped(p)) {
-+    (void)mutex_unlock(&main_arena.mutex);
-     munmap_chunk(p);
-     return;
-   }
-@@ -291,12 +295,11 @@ free_check(mem, caller) Void_t* mem; const Void_t 
*caller;
-   memset(mem, 0, chunksize(p) - (SIZE_SZ+1));
- #endif
- #ifdef ATOMIC_FASTBINS
--  _int_free(&main_arena, p, 0);
-+  _int_free(&main_arena, p, 1);
- #else
--  (void)mutex_lock(&main_arena.mutex);
-   _int_free(&main_arena, p);
--  (void)mutex_unlock(&main_arena.mutex);
- #endif
-+  (void)mutex_unlock(&main_arena.mutex);
- }
- 
- static Void_t*
-@@ -345,13 +348,13 @@ realloc_check(oldmem, bytes, caller)
-       if(oldsize - SIZE_SZ >= nb)
-       newmem = oldmem; /* do nothing */
-       else {
--        /* Must alloc, copy, free. */
--        if (top_check() >= 0)
-+      /* Must alloc, copy, free. */
-+      if (top_check() >= 0)
-         newmem = _int_malloc(&main_arena, bytes+1);
--        if (newmem) {
--          MALLOC_COPY(BOUNDED_N(newmem, bytes+1), oldmem, oldsize - 
2*SIZE_SZ);
--          munmap_chunk(oldp);
--        }
-+      if (newmem) {
-+        MALLOC_COPY(BOUNDED_N(newmem, bytes+1), oldmem, oldsize - 2*SIZE_SZ);
-+        munmap_chunk(oldp);
-+      }
-       }
-     }
-   } else {
-@@ -367,7 +370,7 @@ realloc_check(oldmem, bytes, caller)
-     nb = chunksize(newp);
-     if(oldp<newp || oldp>=chunk_at_offset(newp, nb)) {
-       memset((char*)oldmem + 2*sizeof(mbinptr), 0,
--             oldsize - (2*sizeof(mbinptr)+2*SIZE_SZ+1));
-+           oldsize - (2*sizeof(mbinptr)+2*SIZE_SZ+1));
-     } else if(nb > oldsize+SIZE_SZ) {
-       memset((char*)BOUNDED_N(chunk2mem(newp), bytes) + oldsize,
-            0, nb - (oldsize+SIZE_SZ));
-@@ -626,7 +629,7 @@ public_sET_STATe(Void_t* msptr)
-       mark_bin(&main_arena, i);
-       } else {
-       /* Oops, index computation from chunksize must have changed.
--           Link the whole list into unsorted_chunks.  */
-+         Link the whole list into unsorted_chunks.  */
-       first(b) = last(b) = b;
-       b = unsorted_chunks(&main_arena);
-       ms->av[2*i+2]->bk = b;
-@@ -667,7 +670,7 @@ public_sET_STATe(Void_t* msptr)
-     /* Check whether it is safe to enable malloc checking, or whether
-        it is necessary to disable it.  */
-     if (ms->using_malloc_checking && !using_malloc_checking &&
--        !disallow_malloc_check)
-+      !disallow_malloc_check)
-       __malloc_check_init ();
-     else if (!ms->using_malloc_checking && using_malloc_checking) {
-       __malloc_hook = NULL;

Added: 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc_info-init.diff
===================================================================
--- 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc_info-init.diff 
                            (rev 0)
+++ 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-malloc_info-init.diff 
    2010-02-07 16:43:28 UTC (rev 4150)
@@ -0,0 +1,76 @@
+2010-01-14  Ulrich Drepper  <drep...@redhat.com>
+ 
+       [BZ #11126]
+       * malloc/malloc.c (malloc_info): Initialize malloc if not already
+       done.  Handle empty bin lists.
+ 
+diff --git a/malloc/malloc.c b/malloc/malloc.c
+index ea10d17..b43e454 100644
+--- a/malloc/malloc.c
++++ b/malloc/malloc.c
+@@ -6369,16 +6369,19 @@ malloc_info (int options, FILE *fp)
+ 
+     mbinptr bin = bin_at (ar_ptr, 1);
+     struct malloc_chunk *r = bin->fd;
+-    while (r != bin)
++    if (r != NULL)
+       {
+-      ++sizes[NFASTBINS].count;
+-      sizes[NFASTBINS].total += r->size;
+-      sizes[NFASTBINS].from = MIN (sizes[NFASTBINS].from, r->size);
+-      sizes[NFASTBINS].to = MAX (sizes[NFASTBINS].to, r->size);
+-      r = r->fd;
++      while (r != bin)
++        {
++          ++sizes[NFASTBINS].count;
++          sizes[NFASTBINS].total += r->size;
++          sizes[NFASTBINS].from = MIN (sizes[NFASTBINS].from, r->size);
++          sizes[NFASTBINS].to = MAX (sizes[NFASTBINS].to, r->size);
++          r = r->fd;
++        }
++      nblocks += sizes[NFASTBINS].count;
++      avail += sizes[NFASTBINS].total;
+       }
+-    nblocks += sizes[NFASTBINS].count;
+-    avail += sizes[NFASTBINS].total;
+ 
+     for (size_t i = 2; i < NBINS; ++i)
+       {
+@@ -6388,17 +6391,18 @@ malloc_info (int options, FILE *fp)
+       sizes[NFASTBINS - 1 + i].to = sizes[NFASTBINS - 1 + i].total
+         = sizes[NFASTBINS - 1 + i].count = 0;
+ 
+-      while (r != bin)
+-        {
+-          ++sizes[NFASTBINS - 1 + i].count;
+-          sizes[NFASTBINS - 1 + i].total += r->size;
+-          sizes[NFASTBINS - 1 + i].from = MIN (sizes[NFASTBINS - 1 + i].from,
++      if (r != NULL)
++        while (r != bin)
++          {
++            ++sizes[NFASTBINS - 1 + i].count;
++            sizes[NFASTBINS - 1 + i].total += r->size;
++            sizes[NFASTBINS - 1 + i].from
++              = MIN (sizes[NFASTBINS - 1 + i].from, r->size);
++            sizes[NFASTBINS - 1 + i].to = MAX (sizes[NFASTBINS - 1 + i].to,
+                                                r->size);
+-          sizes[NFASTBINS - 1 + i].to = MAX (sizes[NFASTBINS - 1 + i].to,
+-                                             r->size);
+ 
+-          r = r->fd;
+-        }
++            r = r->fd;
++          }
+ 
+       if (sizes[NFASTBINS - 1 + i].count == 0)
+         sizes[NFASTBINS - 1 + i].from = 0;
+@@ -6460,6 +6464,9 @@ malloc_info (int options, FILE *fp)
+     fputs ("</heap>\n", fp);
+   }
+ 
++  if(__malloc_initialized < 0)
++    ptmalloc_init ();
++
+   fputs ("<malloc version=\"1\">\n", fp);
+ 
+   /* Iterate over all arenas currently in use.  */

Added: 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-resolv-bindv6only.diff
===================================================================
--- 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-resolv-bindv6only.diff
                            (rev 0)
+++ 
glibc-package/branches/eglibc-2.11/debian/patches/any/cvs-resolv-bindv6only.diff
    2010-02-07 16:43:28 UTC (rev 4150)
@@ -0,0 +1,95 @@
+2010-01-14  Ulrich Drepper  <drep...@redhat.com>
+ 
+       [BZ #11141]
+       * resolv/res_send.c (reopen): Don't use IPv6 sockets for IPv4
+       addresses.
+
+diff --git a/resolv/res_send.c b/resolv/res_send.c
+index e2bbfcc..28a47e4 100644
+--- a/resolv/res_send.c
++++ b/resolv/res_send.c
+@@ -199,10 +199,6 @@ static void               Perror(const res_state, FILE *, 
const char *, int);
+ #endif
+ static int            sock_eq(struct sockaddr_in6 *, struct sockaddr_in6 *);
+ 
+-/* Reachover. */
+-
+-static void convaddr4to6(struct sockaddr_in6 *sa);
+-
+ /* Public. */
+ 
+ /* int
+@@ -911,10 +907,12 @@ static int
+ reopen (res_state statp, int *terrno, int ns)
+ {
+       if (EXT(statp).nssocks[ns] == -1) {
+-              struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
++              struct sockaddr *nsap
++                = (struct sockaddr *) EXT(statp).nsaddrs[ns];
++              socklen_t slen;
+ 
+               /* only try IPv6 if IPv6 NS and if not failed before */
+-              if ((EXT(statp).nscount6 > 0) && !statp->ipv6_unavail) {
++              if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) {
+                       if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
+                               EXT(statp).nssocks[ns] =
+                                 socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK,
+@@ -931,12 +929,8 @@ reopen (res_state statp, int *terrno, int ns)
+                                 socket(PF_INET6, SOCK_DGRAM, 0);
+                       if (EXT(statp).nssocks[ns] < 0)
+                           statp->ipv6_unavail = errno == EAFNOSUPPORT;
+-                      /* If IPv6 socket and nsap is IPv4, make it
+-                         IPv4-mapped */
+-                      else if (nsap->sin6_family == AF_INET)
+-                          convaddr4to6(nsap);
+-              }
+-              if (EXT(statp).nssocks[ns] < 0) {
++                      slen = sizeof (struct sockaddr_in6);
++              } else if (nsap->sa_family == AF_INET) {
+                       if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
+                               EXT(statp).nssocks[ns]
+                                 = socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK,
+@@ -951,6 +945,7 @@ reopen (res_state statp, int *terrno, int ns)
+                       if (__builtin_expect (__have_o_nonblock < 0, 0))
+                               EXT(statp).nssocks[ns]
+                                 = socket(PF_INET, SOCK_DGRAM, 0);
++                      slen = sizeof (struct sockaddr_in);
+               }
+               if (EXT(statp).nssocks[ns] < 0) {
+                       *terrno = errno;
+@@ -969,10 +964,8 @@ reopen (res_state statp, int *terrno, int ns)
+                * error message is received.  We can thus detect
+                * the absence of a nameserver without timing out.
+                */
+-              if (connect(EXT(statp).nssocks[ns], (struct sockaddr *)nsap,
+-                          sizeof *nsap) < 0) {
+-                      Aerror(statp, stderr, "connect(dg)", errno,
+-                             (struct sockaddr *) nsap);
++              if (connect(EXT(statp).nssocks[ns], nsap, slen) < 0) {
++                      Aerror(statp, stderr, "connect(dg)", errno, nsap);
+                       __res_iclose(statp, false);
+                       return (0);
+               }
+@@ -1415,22 +1408,3 @@ sock_eq(struct sockaddr_in6 *a1, struct sockaddr_in6 
*a2) {
+               (a1->sin6_addr.s6_addr32[3] ==
+                ((struct sockaddr_in *)a2)->sin_addr.s_addr));
+ }
+-
+-/*
+- * Converts IPv4 family, address and port to
+- * IPv6 family, IPv4-mapped IPv6 address and port.
+- */
+-static void
+-convaddr4to6(struct sockaddr_in6 *sa)
+-{
+-    struct sockaddr_in *sa4p = (struct sockaddr_in *) sa;
+-    in_port_t port = sa4p->sin_port;
+-    in_addr_t addr = sa4p->sin_addr.s_addr;
+-
+-    sa->sin6_family = AF_INET6;
+-    sa->sin6_port = port;
+-    sa->sin6_addr.s6_addr32[0] = 0;
+-    sa->sin6_addr.s6_addr32[1] = 0;
+-    sa->sin6_addr.s6_addr32[2] = htonl(0xFFFF);
+-    sa->sin6_addr.s6_addr32[3] = addr;
+-}

Modified: 
glibc-package/branches/eglibc-2.11/debian/patches/any/local-no-SOCK_NONBLOCK.diff
===================================================================
--- 
glibc-package/branches/eglibc-2.11/debian/patches/any/local-no-SOCK_NONBLOCK.diff
   2010-02-07 15:53:49 UTC (rev 4149)
+++ 
glibc-package/branches/eglibc-2.11/debian/patches/any/local-no-SOCK_NONBLOCK.diff
   2010-02-07 16:43:28 UTC (rev 4150)
@@ -1,28 +1,30 @@
 --- a/resolv/res_send.c
 +++ b/resolv/res_send.c
-@@ -104,11 +104,13 @@
+@@ -103,13 +103,13 @@
+ #define MAXPACKET       65536
  #endif
  
- 
+-
 +#ifdef SOCK_NONBLOCK
  #ifndef __ASSUME_SOCK_CLOEXEC
  static int __have_o_nonblock;
  #else
  # define __have_o_nonblock 0
  #endif
+-
 +#endif
  
- 
  /* From ev_streams.c.  */
-@@ -915,6 +917,7 @@
  
+@@ -913,6 +913,7 @@
+ 
                /* only try IPv6 if IPv6 NS and if not failed before */
-               if ((EXT(statp).nscount6 > 0) && !statp->ipv6_unavail) {
+               if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) {
 +#ifdef SOCK_NONBLOCK
                        if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
                                EXT(statp).nssocks[ns] =
                                  socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK,
-@@ -927,6 +930,7 @@
+@@ -925,12 +926,14 @@
  #endif
                        }
                        if (__builtin_expect (__have_o_nonblock < 0, 0))
@@ -30,23 +32,22 @@
                                EXT(statp).nssocks[ns] =
                                  socket(PF_INET6, SOCK_DGRAM, 0);
                        if (EXT(statp).nssocks[ns] < 0)
-@@ -937,6 +941,7 @@
-                           convaddr4to6(nsap);
-               }
-               if (EXT(statp).nssocks[ns] < 0) {
+                           statp->ipv6_unavail = errno == EAFNOSUPPORT;
+                       slen = sizeof (struct sockaddr_in6);
+               } else if (nsap->sa_family == AF_INET) {
 +#ifdef SOCK_NONBLOCK
                        if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
                                EXT(statp).nssocks[ns]
                                  = socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK,
-@@ -949,6 +954,7 @@
+@@ -943,6 +946,7 @@
  #endif
                        }
                        if (__builtin_expect (__have_o_nonblock < 0, 0))
 +#endif
                                EXT(statp).nssocks[ns]
                                  = socket(PF_INET, SOCK_DGRAM, 0);
-               }
-@@ -976,7 +982,11 @@
+                       slen = sizeof (struct sockaddr_in);
+@@ -969,7 +973,11 @@
                        __res_iclose(statp, false);
                        return (0);
                }
@@ -60,7 +61,7 @@
                        if  (fl != -1)
 --- a/nscd/connections.c
 +++ b/nscd/connections.c
-@@ -1835,6 +1835,7 @@
+@@ -1837,6 +1837,7 @@
              /* We have a new incoming connection.  Accept the connection.  */
              int fd;
  
@@ -68,7 +69,7 @@
  #ifndef __ASSUME_ACCEPT4
              fd = -1;
              if (have_accept4 >= 0)
-@@ -1851,6 +1852,9 @@
+@@ -1853,6 +1854,9 @@
              if (have_accept4 < 0)
                fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
  #endif
@@ -78,7 +79,7 @@
  
              /* Use the descriptor if we have not reached the limit.  */
              if (fd >= 0)
-@@ -2040,7 +2044,7 @@
+@@ -2042,7 +2046,7 @@
          {
            /* A new connection.  */
            int fd;
@@ -87,7 +88,7 @@
  # ifndef __ASSUME_ACCEPT4
            fd = -1;
            if (have_accept4 >= 0)
-@@ -2057,6 +2061,9 @@
+@@ -2059,6 +2063,9 @@
            if (have_accept4 < 0)
              fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
  # endif

Added: 
glibc-package/branches/eglibc-2.11/debian/patches/any/local-ntp-update.diff
===================================================================
--- glibc-package/branches/eglibc-2.11/debian/patches/any/local-ntp-update.diff 
                        (rev 0)
+++ glibc-package/branches/eglibc-2.11/debian/patches/any/local-ntp-update.diff 
2010-02-07 16:43:28 UTC (rev 4150)
@@ -0,0 +1,13 @@
+Partial update of the NTP API, backported from commit 
eb4157390cac6212921ef198353635e138dc0a00
+
+--- a/sysdeps/unix/sysv/linux/sys/timex.h
++++ b/sysdeps/unix/sysv/linux/sys/timex.h      
+@@ -85,6 +85,8 @@
+ #define MOD_TIMECONST ADJ_TIMECONST
+ #define MOD_CLKB      ADJ_TICK
+ #define MOD_CLKA      ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
++#define MOD_MICRO     ADJ_MICRO
++#define MOD_NANO      ADJ_NANO
+ 
+ 
+ /* Status codes (timex.status) */

Added: 
glibc-package/branches/eglibc-2.11/debian/patches/any/submitted-nis-shadow.diff
===================================================================
--- 
glibc-package/branches/eglibc-2.11/debian/patches/any/submitted-nis-shadow.diff 
                            (rev 0)
+++ 
glibc-package/branches/eglibc-2.11/debian/patches/any/submitted-nis-shadow.diff 
    2010-02-07 16:43:28 UTC (rev 4150)
@@ -0,0 +1,303 @@
+2010-01-06  Christoph Pleger <christoph.ple...@cs.tu-dortmund.de>
+           Aurelien Jarno  <aurel...@aurel32.net>
+
+       * nis/nss_nis/nis-pwd.c (internal_nis_getpwent_r): When adjunct
+       style secret password is returned, mangle 'x' instead of the
+       encrypted password.
+       (_nss_nis_getpwnam_r): Likewise.
+       (_nss_nis_getpwuid_r): Likewise.
+       * nis/nss_nis/nis-spwd.c (internal_nis_getspent_r): When shadow.byname
+       does not exist, look in passwd.adjunct.byname and adapt the result.
+       (_nss_nis_getspnam_r): Likewise.
+
+diff --git a/nis/nss_nis/nis-pwd.c b/nis/nss_nis/nis-pwd.c
+index fdc7dc9..efb5c61 100644
+--- a/nis/nss_nis/nis-pwd.c
++++ b/nis/nss_nis/nis-pwd.c
+@@ -266,49 +266,32 @@ internal_nis_getpwent_r (struct passwd *pwd, char 
*buffer, size_t buflen,
+       /* Check for adjunct style secret passwords.  They can be
+        recognized by a password starting with "##".  */
+       char *p = strchr (result, ':');
+-      size_t namelen;
+-      char *result2;
+-      int len2;
+       if (p != NULL   /* This better should be true in all cases.  */
+-        && p[1] == '#' && p[2] == '#'
+-        && (namelen = p - result,
+-            yp_match (domain, "passwd.adjunct.byname", result, namelen,
+-                      &result2, &len2)) == YPERR_SUCCESS)
++        && p[1] == '#' && p[2] == '#')
+       {
+-        /* We found a passwd.adjunct entry.  Merge encrypted
+-           password therein into original result.  */
+-        char *encrypted = strchr (result2, ':');
+-        char *endp;
+-        size_t restlen;
+-
+-        if (encrypted == NULL
+-            || (endp = strchr (++encrypted, ':')) == NULL
+-            || (p = strchr (p + 1, ':')) == NULL)
++        size_t namelen = p - result;
++        if ((p = strchr (p + 1, ':')) == NULL)
+           {
+             /* Invalid format of the entry.  This never should happen
+                unless the data from which the NIS table is generated is
+                wrong.  We simply ignore it.  */
+-            free (result2);
+             goto non_adjunct;
+           }
+ 
+-        restlen = len - (p - result);
+-        if (__builtin_expect ((size_t) (namelen + (endp - encrypted)
+-                                        + restlen + 2) > buflen, 0))
++        /* We found an adjunct style secret password.  Replace
++           it by 'x' into the result.  */
++        size_t restlen = len - (p - result);
++        if (__builtin_expect ((size_t) (namelen + restlen + 3) > buflen, 0))
+           {
+-            free (result2);
+             free (result);
+             *errnop = ERANGE;
+             return NSS_STATUS_TRYAGAIN;
+           }
+ 
+-        mempcpy (mempcpy (mempcpy (mempcpy (buffer, result, namelen),
+-                                   ":", 1),
+-                          encrypted, endp - encrypted),
++        mempcpy (mempcpy (mempcpy (buffer, result, namelen),
++                          ":x", 2),
+                  p, restlen + 1);
+         p = buffer;
+-
+-        free (result2);
+       }
+       else
+       {
+@@ -400,47 +383,32 @@ _nss_nis_getpwnam_r (const char *name, struct passwd 
*pwd,
+ 
+   /* Check for adjunct style secret passwords.  They can be recognized
+      by a password starting with "##".  */
+-  char *result2;
+-  int len2;
+   char *p = strchr (result, ':');
+   if (p != NULL       /* This better should be true in all cases.  */
+-      && p[1] == '#' && p[2] == '#'
+-      && yp_match (domain, "passwd.adjunct.byname", name, namelen,
+-                 &result2, &len2) == YPERR_SUCCESS)
++      && p[1] == '#' && p[2] == '#')
+     {
+-      /* We found a passwd.adjunct entry.  Merge encrypted password
+-       therein into original result.  */
+-      char *encrypted = strchr (result2, ':');
+-      char *endp;
+-
+-      if (encrypted == NULL
+-        || (endp = strchr (++encrypted, ':')) == NULL
+-        || (p = strchr (p + 1, ':')) == NULL)
++      if ((p = strchr (p + 1, ':')) == NULL)
+       {
+         /* Invalid format of the entry.  This never should happen
+            unless the data from which the NIS table is generated is
+            wrong.  We simply ignore it.  */
+-        free (result2);
+         goto non_adjunct;
+       }
+ 
++      /* We found an adjunct style secret password.  Replace
++       it by 'x' into the result.  */
+       size_t restlen = len - (p - result);
+-      if (__builtin_expect ((size_t) (namelen + (endp - encrypted)
+-                                    + restlen + 2) > buflen, 0))
++      if (__builtin_expect ((size_t) (namelen + restlen + 3) > buflen, 0))
+       {
+-        free (result2);
+         free (result);
+         *errnop = ERANGE;
+         return NSS_STATUS_TRYAGAIN;
+       }
+ 
+-      __mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, name, namelen),
+-                                     ":", 1),
+-                          encrypted, endp - encrypted),
+-               p, restlen + 1);
++      __mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
++                           ":x", 2),
++               p, restlen + 1);
+       p = buffer;
+-
+-      free (result2);
+     }
+   else
+     {
+@@ -499,50 +468,33 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
+ 
+   /* Check for adjunct style secret passwords.  They can be recognized
+      by a password starting with "##".  */
+-  char *result2;
+-  int len2;
+-  size_t namelen;
+   char *p = strchr (result, ':');
+   if (p != NULL       /* This better should be true in all cases.  */
+-      && p[1] == '#' && p[2] == '#'
+-      && (namelen = p - result,
+-        yp_match (domain, "passwd.adjunct.byname", result, namelen,
+-                  &result2, &len2)) == YPERR_SUCCESS)
++      && p[1] == '#' && p[2] == '#')
+     {
+-      /* We found a passwd.adjunct entry.  Merge encrypted password
+-       therein into original result.  */
+-      char *encrypted = strchr (result2, ':');
+-      char *endp;
+-      size_t restlen;
+-
+-      if (encrypted == NULL
+-        || (endp = strchr (++encrypted, ':')) == NULL
+-        || (p = strchr (p + 1, ':')) == NULL)
++      size_t namelen = p - result;
++      if ((p = strchr (p + 1, ':')) == NULL)
+       {
+         /* Invalid format of the entry.  This never should happen
+            unless the data from which the NIS table is generated is
+            wrong.  We simply ignore it.  */
+-        free (result2);
+         goto non_adjunct;
+       }
+ 
+-      restlen = len - (p - result);
+-      if (__builtin_expect ((size_t) (namelen + (endp - encrypted)
+-                                    + restlen + 2) > buflen, 0))
++      /* We found an adjunct style secret password.  Replace
++       it by 'x' into the result.  */
++      size_t restlen = len - (p - result);
++      if (__builtin_expect ((size_t) (namelen + restlen + 3) > buflen, 0))
+       {
+-        free (result2);
+         free (result);
+         *errnop = ERANGE;
+         return NSS_STATUS_TRYAGAIN;
+       }
+ 
+-      __mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
+-                                     ":", 1),
+-                          encrypted, endp - encrypted),
+-               p, restlen + 1);
++      __mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
++                         ":x", 2),
++               p, restlen + 1);
+       p = buffer;
+-
+-      free (result2);
+     }
+   else
+     {
+diff --git a/nis/nss_nis/nis-spwd.c b/nis/nss_nis/nis-spwd.c
+index 0fc4e17..9bd1ad6 100644
+--- a/nis/nss_nis/nis-spwd.c
++++ b/nis/nss_nis/nis-spwd.c
+@@ -81,13 +81,38 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, 
size_t buflen,
+       int len;
+       int keylen;
+       int yperr;
++      int adjunct_used = 0;
+ 
+       if (new_start)
+-        yperr = yp_first (domain, "shadow.byname", &outkey, &keylen, &result,
+-                        &len);
++      {
++        yperr = yp_first (domain, "shadow.byname", &outkey, &keylen, &result,
++                          &len);
++
++        if (yperr == YPERR_MAP)
++          {
++            if (result != NULL)
++              free(result);
++
++            yperr = yp_first (domain, "passwd.adjunct.byname", &outkey, 
&keylen,
++                              &result, &len);
++            adjunct_used = 1;
++          }
++      }
+       else
+-        yperr = yp_next (domain, "shadow.byname", oldkey, oldkeylen, &outkey,
+-                       &keylen, &result, &len);
++      {
++        yperr = yp_next (domain, "shadow.byname", oldkey, oldkeylen, &outkey,
++                         &keylen, &result, &len);
++
++        if (yperr == YPERR_MAP)
++          {
++            if (result != NULL)
++              free(result);
++
++            yperr = yp_next (domain, "passwd.adjunct.byname", oldkey, 
oldkeylen,
++                             &outkey, &keylen, &result, &len);
++            adjunct_used = 1;
++          }
++      }
+ 
+       if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+         {
+@@ -98,7 +123,7 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, 
size_t buflen,
+           return retval;
+         }
+ 
+-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
++      if (__builtin_expect ((size_t) (len + (adjunct_used ? 3 : 1)) > buflen, 
0))
+         {
+           free (result);
+         *errnop = ERANGE;
+@@ -107,6 +132,9 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, 
size_t buflen,
+ 
+       char *p = strncpy (buffer, result, len);
+       buffer[len] = '\0';
++      if (adjunct_used)
++        p = strcat (buffer, "::");
++
+       while (isspace (*p))
+         ++p;
+       free (result);
+@@ -149,6 +177,8 @@ enum nss_status
+ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
+                    char *buffer, size_t buflen, int *errnop)
+ {
++  int adjunct_used = 0;
++
+   if (name == NULL)
+     {
+       *errnop = EINVAL;
+@@ -164,6 +194,16 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
+   int yperr = yp_match (domain, "shadow.byname", name, strlen (name), &result,
+                       &len);
+ 
++  if (yperr == YPERR_MAP)
++    {
++      if (result != NULL)
++      free(result);
++
++      yperr = yp_match (domain, "passwd.adjunct.byname", name, strlen (name), 
&result,
++                      &len);
++      adjunct_used = 1;
++  }
++
+   if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+     {
+       enum nss_status retval = yperr2nss (yperr);
+@@ -173,7 +213,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
+       return retval;
+     }
+ 
+-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
++  if (__builtin_expect ((size_t) (len + (adjunct_used ? 3 : 1)) > buflen, 0))
+     {
+       free (result);
+       *errnop = ERANGE;
+@@ -182,6 +222,9 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
+ 
+   char *p = strncpy (buffer, result, len);
+   buffer[len] = '\0';
++  if (adjunct_used)
++    p = strcat (buffer, "::");
++
+   while (isspace (*p))
+     ++p;
+   free (result);

Modified: glibc-package/branches/eglibc-2.11/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.11/debian/patches/series    2010-02-07 
15:53:49 UTC (rev 4149)
+++ glibc-package/branches/eglibc-2.11/debian/patches/series    2010-02-07 
16:43:28 UTC (rev 4150)
@@ -205,4 +205,9 @@
 any/submitted-bits-fcntl_h-at.diff
 any/submitted-getaddrinfo-nodata.diff
 any/submitted-gethostbyname3.diff
+any/local-ntp-update.diff
+#any/cvs-futimens.diff
+any/cvs-malloc_info-init.diff
+any/cvs-resolv-bindv6only.diff
+any/submitted-nis-shadow.diff
 any/local-no-SOCK_NONBLOCK.diff


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to