Hello community,

here is the log from the commit of package glibc for openSUSE:Factory checked 
in at 2017-10-06 10:53:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/glibc (Old)
 and      /work/SRC/openSUSE:Factory/.glibc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "glibc"

Fri Oct  6 10:53:16 2017 rev:214 rq:531231 version:2.26

Changes:
--------
--- /work/SRC/openSUSE:Factory/glibc/glibc-testsuite.changes    2017-09-24 
11:32:35.137001524 +0200
+++ /work/SRC/openSUSE:Factory/.glibc.new/glibc-testsuite.changes       
2017-10-06 10:53:19.337213768 +0200
@@ -1,0 +2,45 @@
+Wed Oct  4 12:14:30 UTC 2017 - [email protected]
+
+- nss-compat.patch: Move nss_compat from nis to nss subdir and install it
+  unconditionally
+- nsswitch.conf: switch back to compat for passwd, group, shadow
+
+-------------------------------------------------------------------
+Thu Sep 28 07:57:52 UTC 2017 - [email protected]
+
+- assert-pedantic.patch: Suppress pedantic warning caused by statement
+  expression (BZ #21242, BZ #21972)
+- math-c++-compat.patch: Add more C++ compatibility
+- getaddrinfo-errno.patch: Fix errno and h_errno handling in getaddrinfo
+  (BZ #21915, BZ #21922)
+- resolv-conf-oom.patch: Fix memory handling in OOM situation during
+  resolv.conf parsing (BZ #22095, BZ #22096)
+- dynarray-allocation.patch: Fix initial size of dynarray allocation and
+  set errno on overflow error
+- nearbyint-inexact.patch: Avoid spurious inexact in nearbyint (BZ #22225)
+
+-------------------------------------------------------------------
+Mon Sep 25 10:12:24 UTC 2017 - [email protected]
+
+- math-c++-compat.patch: add more C++ compatibility (BZ #22146)
+
+-------------------------------------------------------------------
+Tue Sep 12 06:37:36 UTC 2017 - [email protected]
+
+- Remove rpcsvc/yppasswd.* from glibc-devel
+- ld-so-hwcap-x86-64.patch: add x86_64 to hwcap (bsc#1056606, BZ #22093)
+
+-------------------------------------------------------------------
+Thu Aug 31 13:43:07 UTC 2017 - [email protected]
+
+- eh-frame-zero-terminator.patch: Properly terminate .eh_frame (BZ #22051)
+
+-------------------------------------------------------------------
+Thu Aug 31 07:06:20 UTC 2017 - [email protected]
+
+- Disable obsolete libnsl and NIS support
+- remove-nss-nis-compat.patch: remove nis and compat from default NSS
+  configs
+- nsswitch.conf: Likewise
+
+-------------------------------------------------------------------
glibc-utils.changes: same change
glibc.changes: same change

New:
----
  assert-pedantic.patch
  dynarray-allocation.patch
  eh-frame-zero-terminator.patch
  getaddrinfo-errno.patch
  ld-so-hwcap-x86-64.patch
  nearbyint-inexact.patch
  nss-compat.patch
  remove-nss-nis-compat.patch
  resolv-conf-oom.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ glibc-testsuite.spec ++++++
--- /var/tmp/diff_new_pack.ZNofEy/_old  2017-10-06 10:53:21.540880732 +0200
+++ /var/tmp/diff_new_pack.ZNofEy/_new  2017-10-06 10:53:21.544880127 +0200
@@ -269,7 +269,7 @@
 ###
 # Patches from upstream
 ###
-# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts
+# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts (BZ #21885, BZ #21932)
 Patch1000:      resolv-context-leak.patch
 # PATCH-FIX-UPSTREAM Use _dl_runtime_resolve_opt only with AVX512F (BZ #21871)
 Patch1001:      dl-runtime-resolve-opt-avx512f.patch
@@ -277,6 +277,24 @@
 Patch1002:      libpthread-compat-wrappers.patch
 # PATCH-FIX-UPSTREAM Do not use __builtin_types_compatible_p in C++ mode (BZ 
#21930)
 Patch1003:      math-c++-compat.patch
+# PATCH-FIX-UPSTREAM Remove nis and compat from default NSS configs
+Patch1004:      remove-nss-nis-compat.patch
+# PATCH-FIX-UPSTREAM Properly terminate .eh_frame (BZ #22051)
+Patch1005:      eh-frame-zero-terminator.patch
+# PATCH-FIX-UPSTREAM x86: Add x86_64 to x86-64 HWCAP (BZ #22093)
+Patch1006:      ld-so-hwcap-x86-64.patch
+# PATCH-FIX-UPSTREAM assert: Suppress pedantic warning caused by statement 
expression (BZ #21242, BZ #21972)
+Patch1007:      assert-pedantic.patch
+# PATCH-FIX-UPSTREAM Fix errno and h_errno handling in getaddrinfo (BZ #21915, 
BZ #21922)
+Patch1008:      getaddrinfo-errno.patch
+# PATCH-FIX-UPSTREAM Fix memory handling in OOM situation during resolv.conf 
parsing (BZ #22095, BZ #22096)
+Patch1009:      resolv-conf-oom.patch
+# PATCH-FIX-UPSTREAM Fix initial size of dynarray allocation and set errno on 
overflow error
+Patch1010:      dynarray-allocation.patch
+# PATCH-FIX-UPSTREAM Avoid spurious inexact in nearbyint (BZ #22225)
+Patch1011:      nearbyint-inexact.patch
+# PATCH-FIX-UPSTREAM Move nss_compat from nis to nss subdir and install it 
unconditionally
+Patch1012:      nss-compat.patch
 
 ### 
 # Patches awaiting upstream approval
@@ -510,6 +528,15 @@
 %patch1001 -p1
 %patch1002 -p1
 %patch1003 -p1
+%patch1004 -p1
+%patch1005 -p1
+%patch1006 -p1
+%patch1007 -p1
+%patch1008 -p1
+%patch1009 -p1
+%patch1010 -p1
+%patch1011 -p1
+%patch1012 -p1
 
 %patch2000 -p1
 %patch2001 -p1
@@ -677,7 +704,7 @@
                --enable-kernel=%{enablekernel} \
                --with-bugurl=http://bugs.opensuse.org \
                --enable-bind-now \
-               --enable-obsolete-rpc --enable-obsolete-nsl \
+               --enable-obsolete-rpc \
                --disable-timezone-tools
 # Should we enable --enable-systemtap?
 # Should we enable --enable-nss-crypt to build use freebl3 hash functions?
@@ -769,12 +796,6 @@
 make man
 popd
 
-#######################################################################
-###
-### CHECK
-###
-#######################################################################
-
 %check
 %if %{build_testsuite}
 # The testsuite will fail if asneeded is used
@@ -916,6 +937,11 @@
 mkdir -p %{buildroot}/%{_lib}/obsolete
 %endif
 
+# remove nsl compat library
+rm -f %{buildroot}%{_libdir}/libnsl*
+# part of libnsl-devel
+rm -f %{buildroot}%{_includedir}/rpcsvc/yppasswd.*
+
 # Miscelanna:
 
 install -m 0700 glibc_post_upgrade %{buildroot}%{_sbindir}
@@ -1202,10 +1228,6 @@
 /%{_lib}/libnss_files.so.2
 /%{_lib}/libnss_hesiod-%{libversion}.so
 /%{_lib}/libnss_hesiod.so.2
-/%{_lib}/libnss_nis-%{libversion}.so
-/%{_lib}/libnss_nis.so.2
-/%{_lib}/libnss_nisplus-%{libversion}.so
-/%{_lib}/libnss_nisplus.so.2
 /%{_lib}/libpthread-%{libversion}.so
 /%{_lib}/libpthread.so.0
 /%{_lib}/libresolv-%{libversion}.so
@@ -1318,7 +1340,6 @@
 %{_libdir}/libm-%{libversion}.a
 %{_libdir}/libmvec.a
 %endif
-%{_libdir}/libnsl.a
 %{_libdir}/libpthread.a
 %{_libdir}/libresolv.a
 %{_libdir}/librt.a
@@ -1374,7 +1395,6 @@
 %{_libdir}/libowcrypt_p.a
 %{_libdir}/libpthread_p.a
 %{_libdir}/libresolv_p.a
-%{_libdir}/libnsl_p.a
 %{_libdir}/librt_p.a
 %{_libdir}/librpcsvc_p.a
 %{_libdir}/libutil_p.a

glibc-utils.spec: same change
++++++ glibc.spec ++++++
--- /var/tmp/diff_new_pack.ZNofEy/_old  2017-10-06 10:53:21.588873479 +0200
+++ /var/tmp/diff_new_pack.ZNofEy/_new  2017-10-06 10:53:21.592872874 +0200
@@ -275,7 +275,7 @@
 ###
 # Patches from upstream
 ###
-# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts
+# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts (BZ #21885, BZ #21932)
 Patch1000:      resolv-context-leak.patch
 # PATCH-FIX-UPSTREAM Use _dl_runtime_resolve_opt only with AVX512F (BZ #21871)
 Patch1001:      dl-runtime-resolve-opt-avx512f.patch
@@ -283,6 +283,24 @@
 Patch1002:      libpthread-compat-wrappers.patch
 # PATCH-FIX-UPSTREAM Do not use __builtin_types_compatible_p in C++ mode (BZ 
#21930)
 Patch1003:      math-c++-compat.patch
+# PATCH-FIX-UPSTREAM Remove nis and compat from default NSS configs
+Patch1004:      remove-nss-nis-compat.patch
+# PATCH-FIX-UPSTREAM Properly terminate .eh_frame (BZ #22051)
+Patch1005:      eh-frame-zero-terminator.patch
+# PATCH-FIX-UPSTREAM x86: Add x86_64 to x86-64 HWCAP (BZ #22093)
+Patch1006:      ld-so-hwcap-x86-64.patch
+# PATCH-FIX-UPSTREAM assert: Suppress pedantic warning caused by statement 
expression (BZ #21242, BZ #21972)
+Patch1007:      assert-pedantic.patch
+# PATCH-FIX-UPSTREAM Fix errno and h_errno handling in getaddrinfo (BZ #21915, 
BZ #21922)
+Patch1008:      getaddrinfo-errno.patch
+# PATCH-FIX-UPSTREAM Fix memory handling in OOM situation during resolv.conf 
parsing (BZ #22095, BZ #22096)
+Patch1009:      resolv-conf-oom.patch
+# PATCH-FIX-UPSTREAM Fix initial size of dynarray allocation and set errno on 
overflow error
+Patch1010:      dynarray-allocation.patch
+# PATCH-FIX-UPSTREAM Avoid spurious inexact in nearbyint (BZ #22225)
+Patch1011:      nearbyint-inexact.patch
+# PATCH-FIX-UPSTREAM Move nss_compat from nis to nss subdir and install it 
unconditionally
+Patch1012:      nss-compat.patch
 
 ### 
 # Patches awaiting upstream approval
@@ -516,6 +534,15 @@
 %patch1001 -p1
 %patch1002 -p1
 %patch1003 -p1
+%patch1004 -p1
+%patch1005 -p1
+%patch1006 -p1
+%patch1007 -p1
+%patch1008 -p1
+%patch1009 -p1
+%patch1010 -p1
+%patch1011 -p1
+%patch1012 -p1
 
 %patch2000 -p1
 %patch2001 -p1
@@ -683,7 +710,7 @@
                --enable-kernel=%{enablekernel} \
                --with-bugurl=http://bugs.opensuse.org \
                --enable-bind-now \
-               --enable-obsolete-rpc --enable-obsolete-nsl \
+               --enable-obsolete-rpc \
                --disable-timezone-tools
 # Should we enable --enable-systemtap?
 # Should we enable --enable-nss-crypt to build use freebl3 hash functions?
@@ -775,12 +802,6 @@
 make man
 popd
 
-#######################################################################
-###
-### CHECK
-###
-#######################################################################
-
 %check
 %if %{build_testsuite}
 # The testsuite will fail if asneeded is used
@@ -922,6 +943,11 @@
 mkdir -p %{buildroot}/%{_lib}/obsolete
 %endif
 
+# remove nsl compat library
+rm -f %{buildroot}%{_libdir}/libnsl*
+# part of libnsl-devel
+rm -f %{buildroot}%{_includedir}/rpcsvc/yppasswd.*
+
 # Miscelanna:
 
 install -m 0700 glibc_post_upgrade %{buildroot}%{_sbindir}
@@ -1208,10 +1234,6 @@
 /%{_lib}/libnss_files.so.2
 /%{_lib}/libnss_hesiod-%{libversion}.so
 /%{_lib}/libnss_hesiod.so.2
-/%{_lib}/libnss_nis-%{libversion}.so
-/%{_lib}/libnss_nis.so.2
-/%{_lib}/libnss_nisplus-%{libversion}.so
-/%{_lib}/libnss_nisplus.so.2
 /%{_lib}/libpthread-%{libversion}.so
 /%{_lib}/libpthread.so.0
 /%{_lib}/libresolv-%{libversion}.so
@@ -1324,7 +1346,6 @@
 %{_libdir}/libm-%{libversion}.a
 %{_libdir}/libmvec.a
 %endif
-%{_libdir}/libnsl.a
 %{_libdir}/libpthread.a
 %{_libdir}/libresolv.a
 %{_libdir}/librt.a
@@ -1380,7 +1401,6 @@
 %{_libdir}/libowcrypt_p.a
 %{_libdir}/libpthread_p.a
 %{_libdir}/libresolv_p.a
-%{_libdir}/libnsl_p.a
 %{_libdir}/librt_p.a
 %{_libdir}/librpcsvc_p.a
 %{_libdir}/libutil_p.a

++++++ assert-pedantic.patch ++++++
2017-08-21  Florian Weimer  <[email protected]>

        [BZ #21972]
        * assert/assert.h (assert): Use static_cast (bool) for C++.
        Use the ternary operator in the warning branch for GNU C.
        * assert/Makefile (tests): Add tst-assert-c++, tst-assert-g++.
        (CFLAGS-tst-assert-c++.o): Compile in C++11 mode.
        (CFLAGS-tst-assert-g++.o): Compile in GnU C++11 mode.
        (LDLIBS-tst-assert-c++, LDLIBS-tst-assert-g++): Link with libstdc++.
        * assert/tst-assert-c++.cc, assert/tst-assert-g++.cc: New files.

2017-08-11  Florian Weimer  <[email protected]>

        [BZ #21242]
        * assert/assert.h [__GNUC__ && !__STRICT_ANSI__] (assert):
        Suppress pedantic warning resulting from statement expression.
        (__ASSERT_FUNCTION): Add missing __extension__.

Index: glibc-2.26/assert/Makefile
===================================================================
--- glibc-2.26.orig/assert/Makefile
+++ glibc-2.26/assert/Makefile
@@ -25,6 +25,15 @@ include ../Makeconfig
 headers        := assert.h
 
 routines := assert assert-perr __assert
-tests := test-assert test-assert-perr
+tests := test-assert test-assert-perr tst-assert-c++ tst-assert-g++
 
 include ../Rules
+
+ifeq ($(have-cxx-thread_local),yes)
+CFLAGS-tst-assert-c++.o = -std=c++11
+LDLIBS-tst-assert-c++ = -lstdc++
+CFLAGS-tst-assert-g++.o = -std=gnu++11
+LDLIBS-tst-assert-g++ = -lstdc++
+else
+tests-unsupported += tst-assert-c++ tst-assert-g++
+endif
Index: glibc-2.26/assert/assert.h
===================================================================
--- glibc-2.26.orig/assert/assert.h
+++ glibc-2.26/assert/assert.h
@@ -85,19 +85,29 @@ __END_DECLS
 /* When possible, define assert so that it does not add extra
    parentheses around EXPR.  Otherwise, those added parentheses would
    suppress warnings we'd expect to be detected by gcc's -Wparentheses.  */
-# if !defined __GNUC__ || defined __STRICT_ANSI__
+# if defined __cplusplus
+#  define assert(expr)                                                 \
+     (static_cast <bool> (expr)                                                
\
+      ? void (0)                                                       \
+      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
+# elif !defined __GNUC__ || defined __STRICT_ANSI__
 #  define assert(expr)                                                 \
     ((expr)                                                            \
      ? __ASSERT_VOID_CAST (0)                                          \
      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
 # else
+/* The first occurrence of EXPR is not evaluated due to the sizeof,
+   but will trigger any pedantic warnings masked by the __extension__
+   for the second occurrence.  The ternary operator is required to
+   support function pointers and bit fields in this context, and to
+   suppress the evaluation of variable length arrays.  */
 #  define assert(expr)                                                 \
-    ({                                                                 \
+  ((void) sizeof ((expr) ? 1 : 0), __extension__ ({                    \
       if (expr)                                                                
\
         ; /* empty */                                                  \
       else                                                             \
         __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION);  \
-    })
+    }))
 # endif
 
 # ifdef        __USE_GNU
@@ -113,7 +123,7 @@ __END_DECLS
    C9x has a similar variable called __func__, but prefer the GCC one since
    it demangles C++ function names.  */
 # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-#   define __ASSERT_FUNCTION   __PRETTY_FUNCTION__
+#   define __ASSERT_FUNCTION   __extension__ __PRETTY_FUNCTION__
 # else
 #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
 #   define __ASSERT_FUNCTION   __func__
Index: glibc-2.26/assert/tst-assert-c++.cc
===================================================================
--- /dev/null
+++ glibc-2.26/assert/tst-assert-c++.cc
@@ -0,0 +1,78 @@
+/* Tests for interactions between C++ and assert.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+
+/* The C++ standard requires that if the assert argument is a constant
+   subexpression, then the assert itself is one, too.  */
+constexpr int
+check_constexpr ()
+{
+  return (assert (true), 1);
+}
+
+/* Objects of this class can be contextually converted to bool, but
+   cannot be compared to int.  */
+struct no_int
+{
+  no_int () = default;
+  no_int (const no_int &) = delete;
+
+  explicit operator bool () const
+  {
+    return true;
+  }
+
+  bool operator! () const; /* No definition.  */
+  template <class T> bool operator== (T) const; /* No definition.  */
+  template <class T> bool operator!= (T) const; /* No definition.  */
+};
+
+/* This class tests that operator== is not used by assert.  */
+struct bool_and_int
+{
+  bool_and_int () = default;
+  bool_and_int (const no_int &) = delete;
+
+  explicit operator bool () const
+  {
+    return true;
+  }
+
+  bool operator! () const; /* No definition.  */
+  template <class T> bool operator== (T) const; /* No definition.  */
+  template <class T> bool operator!= (T) const; /* No definition.  */
+};
+
+static int
+do_test ()
+{
+  {
+    no_int value;
+    assert (value);
+  }
+
+  {
+    bool_and_int value;
+    assert (value);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
Index: glibc-2.26/assert/tst-assert-g++.cc
===================================================================
--- /dev/null
+++ glibc-2.26/assert/tst-assert-g++.cc
@@ -0,0 +1,19 @@
+/* Tests for interactions between C++ and assert.  GNU C++11 version.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <tst-assert-c++.cc>
++++++ dynarray-allocation.patch ++++++
2017-08-30  Florian Weimer  <[email protected]>

        * malloc/dynarray_emplace_enlarge.c
        (__libc_dynarray_emplace_enlarge): Set errno on overflow.
        * malloc/dynarray_resize.c (__libc_dynarray_resize): Likewise.
        * malloc/tst-dynarray.c (test_long_overflow): New function.
        (do_test): Call it.

2017-09-06  Florian Weimer  <[email protected]>

        * malloc/dynarray_emplace_enlarge.c
        (__libc_dynarray_emplace_enlarge): Add missing else.

Index: glibc-2.26/malloc/dynarray_emplace_enlarge.c
===================================================================
--- glibc-2.26.orig/malloc/dynarray_emplace_enlarge.c
+++ glibc-2.26/malloc/dynarray_emplace_enlarge.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <dynarray.h>
+#include <errno.h>
 #include <malloc-internal.h>
 #include <stdlib.h>
 #include <string.h>
@@ -32,7 +33,7 @@ __libc_dynarray_emplace_enlarge (struct
          size.  */
       if (element_size < 4)
         new_allocated = 16;
-      if (element_size < 8)
+      else if (element_size < 8)
         new_allocated = 8;
       else
         new_allocated = 4;
@@ -43,8 +44,11 @@ __libc_dynarray_emplace_enlarge (struct
     {
       new_allocated = list->allocated + list->allocated / 2 + 1;
       if (new_allocated <= list->allocated)
-        /* Overflow.  */
-        return false;
+        {
+          /* Overflow.  */
+          __set_errno (ENOMEM);
+          return false;
+        }
     }
 
   size_t new_size;
Index: glibc-2.26/malloc/dynarray_resize.c
===================================================================
--- glibc-2.26.orig/malloc/dynarray_resize.c
+++ glibc-2.26/malloc/dynarray_resize.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <dynarray.h>
+#include <errno.h>
 #include <malloc-internal.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,7 +39,11 @@ __libc_dynarray_resize (struct dynarray_
 
   size_t new_size_bytes;
   if (check_mul_overflow_size_t (size, element_size, &new_size_bytes))
-    return false;
+    {
+      /* Overflow.  */
+      __set_errno (ENOMEM);
+      return false;
+    }
   void *new_array;
   if (list->array == scratch)
     {
Index: glibc-2.26/malloc/tst-dynarray.c
===================================================================
--- glibc-2.26.orig/malloc/tst-dynarray.c
+++ glibc-2.26/malloc/tst-dynarray.c
@@ -18,6 +18,9 @@
 
 #include "tst-dynarray-shared.h"
 
+#include <errno.h>
+#include <stdint.h>
+
 #define DYNARRAY_STRUCT dynarray_long
 #define DYNARRAY_ELEMENT long
 #define DYNARRAY_PREFIX dynarray_long_
@@ -463,6 +466,31 @@ test_long_init (void)
   }
 }
 
+/* Test overflow in resize.  */
+static void
+test_long_overflow (void)
+{
+  {
+    struct dynarray_long dyn;
+    dynarray_long_init (&dyn);
+    errno = EINVAL;
+    TEST_VERIFY (!dynarray_long_resize
+                 (&dyn, (SIZE_MAX / sizeof (long)) + 1));
+    TEST_VERIFY (errno == ENOMEM);
+    TEST_VERIFY (dynarray_long_has_failed (&dyn));
+  }
+
+  {
+    struct dynarray_long_noscratch dyn;
+    dynarray_long_noscratch_init (&dyn);
+    errno = EINVAL;
+    TEST_VERIFY (!dynarray_long_noscratch_resize
+                 (&dyn, (SIZE_MAX / sizeof (long)) + 1));
+    TEST_VERIFY (errno == ENOMEM);
+    TEST_VERIFY (dynarray_long_noscratch_has_failed (&dyn));
+  }
+}
+
 /* Test NUL-terminated string construction with the add function and
    the simple finalize function.  */
 static void
@@ -538,6 +566,7 @@ do_test (void)
   test_int ();
   test_str ();
   test_long_init ();
+  test_long_overflow ();
   test_zstr ();
   return 0;
 }
++++++ eh-frame-zero-terminator.patch ++++++
2017-08-31  H.J. Lu  <[email protected]>

        [BZ #22051]
        * Makerules (build-module-helper-objlist): Filter out
        $(elf-objpfx)sofini.os.
        (build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
        needed.

Index: glibc-2.26/Makerules
===================================================================
--- glibc-2.26.orig/Makerules
+++ glibc-2.26/Makerules
@@ -686,14 +686,17 @@ $(build-module-helper) -o $@ $(shlib-lds
 $(call after-link,$@)
 endef
 
+# sofini.os must be placed last since it terminates .eh_frame section.
 build-module-helper-objlist = \
        $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
                   $(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \
+                               $(elf-objpfx)sofini.os \
                                $(link-libc-deps),$^))
 
 build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
 build-shlib-objlist = $(build-module-helper-objlist) \
-                     $(LDLIBS-$(@F:lib%.so=%).so)
+                     $(LDLIBS-$(@F:lib%.so=%).so) \
+                     $(filter $(elf-objpfx)sofini.os,$^)
 
 # Don't try to use -lc when making libc.so itself.
 # Also omits crti.o and crtn.o, which we do not want
++++++ getaddrinfo-errno.patch ++++++
++++ 649 lines (skipped)


++++++ ld-so-hwcap-x86-64.patch ++++++
2017-09-11  H.J. Lu  <[email protected]>

        [BZ #22093]
        * sysdeps/x86/cpu-features.c (init_cpu_features): Initialize
        GLRO(dl_hwcap) to HWCAP_X86_64 for x86-64.
        * sysdeps/x86/dl-hwcap.h (HWCAP_COUNT): Updated.
        (HWCAP_IMPORTANT): Likewise.
        (HWCAP_X86_64): New enum.
        (HWCAP_X86_AVX512_1): Updated.
        * sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): Add "x86_64".
        * sysdeps/x86_64/Makefile (tests): Add tst-x86_64-1.
        (modules-names): Add x86_64/tst-x86_64mod-1.
        (LDFLAGS-tst-x86_64mod-1.so): New.
        ($(objpfx)tst-x86_64-1): Likewise.
        ($(objpfx)x86_64/tst-x86_64mod-1.os): Likewise.
        (tst-x86_64-1-clean): Likewise.
        * sysdeps/x86_64/tst-x86_64-1.c: New file.
        * sysdeps/x86_64/tst-x86_64mod-1.c: Likewise.

Index: glibc-2.26/sysdeps/x86/cpu-features.c
===================================================================
--- glibc-2.26.orig/sysdeps/x86/cpu-features.c
+++ glibc-2.26/sysdeps/x86/cpu-features.c
@@ -336,7 +336,6 @@ no_cpuid:
 
   /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86.  */
   GLRO(dl_platform) = NULL;
-  GLRO(dl_hwcap) = 0;
 #if !HAVE_TUNABLES && defined SHARED
   /* The glibc.tune.hwcap_mask tunable is initialized already, so no need to do
      this.  */
@@ -344,6 +343,7 @@ no_cpuid:
 #endif
 
 #ifdef __x86_64__
+  GLRO(dl_hwcap) = HWCAP_X86_64;
   if (cpu_features->kind == arch_kind_intel)
     {
       if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
@@ -374,6 +374,7 @@ no_cpuid:
        GLRO(dl_platform) = "haswell";
     }
 #else
+  GLRO(dl_hwcap) = 0;
   if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
     GLRO(dl_hwcap) |= HWCAP_X86_SSE2;
 
Index: glibc-2.26/sysdeps/x86/dl-hwcap.h
===================================================================
--- glibc-2.26.orig/sysdeps/x86/dl-hwcap.h
+++ glibc-2.26/sysdeps/x86/dl-hwcap.h
@@ -24,15 +24,16 @@
 # define HWCAP_PLATFORMS_START 0
 # define HWCAP_PLATFORMS_COUNT 4
 # define HWCAP_START           0
-# define HWCAP_COUNT           2
-# define HWCAP_IMPORTANT       (HWCAP_X86_SSE2 | HWCAP_X86_AVX512_1)
+# define HWCAP_COUNT           3
+# define HWCAP_IMPORTANT \
+  (HWCAP_X86_SSE2 | HWCAP_X86_64 | HWCAP_X86_AVX512_1)
 #elif defined __x86_64__
 /* For 64 bit, only cover x86-64 platforms and capabilities.  */
 # define HWCAP_PLATFORMS_START 2
 # define HWCAP_PLATFORMS_COUNT 4
 # define HWCAP_START           1
-# define HWCAP_COUNT           2
-# define HWCAP_IMPORTANT       (HWCAP_X86_AVX512_1)
+# define HWCAP_COUNT           3
+# define HWCAP_IMPORTANT       (HWCAP_X86_64 | HWCAP_X86_AVX512_1)
 #else
 /* For 32 bit, only cover i586, i686 and SSE2.  */
 # define HWCAP_PLATFORMS_START 0
@@ -45,7 +46,8 @@
 enum
 {
   HWCAP_X86_SSE2               = 1 << 0,
-  HWCAP_X86_AVX512_1           = 1 << 1
+  HWCAP_X86_64                 = 1 << 1,
+  HWCAP_X86_AVX512_1           = 1 << 2
 };
 
 static inline const char *
Index: glibc-2.26/sysdeps/x86/dl-procinfo.c
===================================================================
--- glibc-2.26.orig/sysdeps/x86/dl-procinfo.c
+++ glibc-2.26/sysdeps/x86/dl-procinfo.c
@@ -58,11 +58,11 @@ PROCINFO_CLASS struct cpu_features _dl_x
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_x86_hwcap_flags
 #else
-PROCINFO_CLASS const char _dl_x86_hwcap_flags[2][9]
+PROCINFO_CLASS const char _dl_x86_hwcap_flags[3][9]
 #endif
 #ifndef PROCINFO_DECL
 = {
-    "sse2", "avx512_1"
+    "sse2", "x86_64", "avx512_1"
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
Index: glibc-2.26/sysdeps/x86_64/Makefile
===================================================================
--- glibc-2.26.orig/sysdeps/x86_64/Makefile
+++ glibc-2.26/sysdeps/x86_64/Makefile
@@ -52,6 +52,12 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quad
 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 
+tests += tst-x86_64-1
+modules-names += x86_64/tst-x86_64mod-1
+LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
+
+$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
+
 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
         tst-audit10 tst-sse tst-avx tst-avx512
 test-extras += tst-audit4-aux tst-audit10-aux \
@@ -122,3 +128,14 @@ endif
 ifeq ($(subdir),csu)
 gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
 endif
+
+$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
+       $(make-target-directory)
+       rm -f $@
+       ln $< $@
+
+do-tests-clean common-mostlyclean: tst-x86_64-1-clean
+
+.PHONY: tst-x86_64-1-clean
+tst-x86_64-1-clean:
+       -rm -rf $(objpfx)x86_64
Index: glibc-2.26/sysdeps/x86_64/tst-x86_64-1.c
===================================================================
--- /dev/null
+++ glibc-2.26/sysdeps/x86_64/tst-x86_64-1.c
@@ -0,0 +1,26 @@
+/* Test searching the "x86_64" directory for shared libraries.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+extern void foo (void);
+
+int
+main (void)
+{
+  foo ();
+  return 0;
+}
Index: glibc-2.26/sysdeps/x86_64/tst-x86_64mod-1.c
===================================================================
--- /dev/null
+++ glibc-2.26/sysdeps/x86_64/tst-x86_64mod-1.c
@@ -0,0 +1,22 @@
+/* Test searching the "x86_64" directory for shared libraries.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+void
+foo (void)
+{
+}
++++++ math-c++-compat.patch ++++++
--- /var/tmp/diff_new_pack.ZNofEy/_old  2017-10-06 10:53:21.868831170 +0200
+++ /var/tmp/diff_new_pack.ZNofEy/_new  2017-10-06 10:53:21.868831170 +0200
@@ -1,3 +1,9 @@
+2017-09-22  Gabriel F. T. Gomes  <[email protected]>
+
+       [BZ #22146]
+       math/math.h: Let fpclassify use the builtin in C++ mode, even
+       when optimazing for size.
+
 2017-08-28  Gabriel F. T. Gomes  <[email protected]>
 
        [BZ #21930]
@@ -26,11 +32,31 @@
        * math/math.h (isinf): Check if in C or C++ mode before using
        __builtin_types_compatible_p, since this is a C mode feature.
 
+2017-08-18  Gabriel F. T. Gomes  <[email protected]>
+
+       * misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
+       in C++ mode.
+
 Index: glibc-2.26/math/math.h
 ===================================================================
 --- glibc-2.26.orig/math/math.h
 +++ glibc-2.26/math/math.h
-@@ -442,8 +442,12 @@ enum
+@@ -402,7 +402,13 @@ enum
+ 
+ /* Return number of classification appropriate for X.  */
+ # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__                       \
+-     && !defined __OPTIMIZE_SIZE__
++     && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus)
++     /* The check for __cplusplus allows the use of the builtin, even
++      when optimization for size is on.  This is provided for
++      libstdc++, only to let its configure test work when it is built
++      with -Os.  No further use of this definition of fpclassify is
++      expected in C++ mode, since libstdc++ provides its own version
++      of fpclassify in cmath (which undefines fpclassify).  */
+ #  define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE,          \
+      FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
+ # else
+@@ -442,8 +448,12 @@ enum
  
  /* Return nonzero value if X is positive or negative infinity.  */
  # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
@@ -45,7 +71,7 @@
  #  define isinf(x) \
      (__builtin_types_compatible_p (__typeof (x), _Float128) \
       ? __isinff128 (x) : __builtin_isinf_sign (x))
-@@ -470,7 +474,32 @@ enum
+@@ -470,7 +480,32 @@ enum
  # include <bits/iscanonical.h>
  
  /* Return nonzero value if X is a signaling NaN.  */
@@ -79,7 +105,7 @@
  
  /* Return nonzero value if X is subnormal.  */
  # define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL)
-@@ -484,15 +513,40 @@ enum
+@@ -484,15 +519,40 @@ enum
  #  endif
  # else        /* __cplusplus */
  extern "C++" {
@@ -124,3 +150,35 @@
  } /* extern C++ */
  # endif       /* __cplusplus */
  #endif /* Use IEC_60559_BFP_EXT.  */
+Index: glibc-2.26/misc/sys/cdefs.h
+===================================================================
+--- glibc-2.26.orig/misc/sys/cdefs.h
++++ glibc-2.26/misc/sys/cdefs.h
+@@ -464,17 +464,18 @@
+ # define __glibc_macro_warning(msg)
+ #endif
+ 
+-/* Support for generic selection (ISO C11) is available in GCC since
+-   version 4.9.  Previous versions do not provide generic selection,
+-   even though they might set __STDC_VERSION__ to 201112L, when in
+-   -std=c11 mode.  Thus, we must check for !defined __GNUC__ when
+-   testing __STDC_VERSION__ for generic selection support.
++/* Generic selection (ISO C11) is a C-only feature, available in GCC
++   since version 4.9.  Previous versions do not provide generic
++   selection, even though they might set __STDC_VERSION__ to 201112L,
++   when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
++   when testing __STDC_VERSION__ for generic selection support.
+    On the other hand, Clang also defines __GNUC__, so a clang-specific
+    check is required to enable the use of generic selection.  */
+-#if __GNUC_PREREQ (4, 9) \
+-    || __glibc_clang_has_extension (c_generic_selections) \
+-    || (!defined __GNUC__ && defined __STDC_VERSION__ \
+-      && __STDC_VERSION__ >= 201112L)
++#if !defined __cplusplus \
++    && (__GNUC_PREREQ (4, 9) \
++      || __glibc_clang_has_extension (c_generic_selections) \
++      || (!defined __GNUC__ && defined __STDC_VERSION__ \
++          && __STDC_VERSION__ >= 201112L))
+ # define __HAVE_GENERIC_SELECTION 1
+ #else
+ # define __HAVE_GENERIC_SELECTION 0

++++++ nearbyint-inexact.patch ++++++
2017-09-28  Joseph Myers  <[email protected]>

        [BZ #22225]
        * sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
        math_opt_barrier on argument when doing arithmetic on it.
        * sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint):
        Likewise.  Use math_force_eval not math_opt_barrier after
        arithmetic.
        * sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Use
        math_opt_barrier on argument when doing arithmetic on it.
        * sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl):
        Likewise.

Index: glibc-2.26/sysdeps/ieee754/dbl-64/s_nearbyint.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ glibc-2.26/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -48,7 +48,7 @@ __nearbyint (double x)
       if (j0 < 0)
        {
          libc_feholdexcept (&env);
-         w = TWO52[sx] + x;
+         w = TWO52[sx] + math_opt_barrier (x);
          t = w - TWO52[sx];
          math_force_eval (t);
          libc_fesetenv (&env);
@@ -65,7 +65,7 @@ __nearbyint (double x)
        return x;                       /* x is integral */
     }
   libc_feholdexcept (&env);
-  w = TWO52[sx] + x;
+  w = TWO52[sx] + math_opt_barrier (x);
   t = w - TWO52[sx];
   math_force_eval (t);
   libc_fesetenv (&env);
Index: glibc-2.26/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ glibc-2.26/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -42,9 +42,9 @@ __nearbyint(double x)
        if(__builtin_expect(j0<52, 1)) {
            if(j0<0) {
                libc_feholdexcept (&env);
-               double w = TWO52[sx]+x;
+               double w = TWO52[sx] + math_opt_barrier (x);
                double t =  w-TWO52[sx];
-               math_opt_barrier(t);
+               math_force_eval (t);
                libc_fesetenv (&env);
                return __copysign (t, x);
            }
@@ -53,9 +53,9 @@ __nearbyint(double x)
            else return x;              /* x is integral */
        }
        libc_feholdexcept (&env);
-       double w = TWO52[sx]+x;
+       double w = TWO52[sx] + math_opt_barrier (x);
        double t = w-TWO52[sx];
-       math_opt_barrier (t);
+       math_force_eval (t);
        libc_fesetenv (&env);
        return t;
 }
Index: glibc-2.26/sysdeps/ieee754/flt-32/s_nearbyintf.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ glibc-2.26/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -37,7 +37,7 @@ __nearbyintf(float x)
        if(j0<23) {
            if(j0<0) {
                libc_feholdexceptf (&env);
-               w = TWO23[sx]+x;
+               w = TWO23[sx] + math_opt_barrier (x);
                t =  w-TWO23[sx];
                math_force_eval (t);
                libc_fesetenvf (&env);
@@ -50,7 +50,7 @@ __nearbyintf(float x)
            else return x;              /* x is integral */
        }
        libc_feholdexceptf (&env);
-       w = TWO23[sx]+x;
+       w = TWO23[sx] + math_opt_barrier (x);
        t = w-TWO23[sx];
        math_force_eval (t);
        libc_fesetenvf (&env);
Index: glibc-2.26/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ glibc-2.26/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -45,7 +45,7 @@ _Float128 __nearbyintl(_Float128 x)
        if(j0<112) {
            if(j0<0) {
                feholdexcept (&env);
-               w = TWO112[sx]+x;
+               w = TWO112[sx] + math_opt_barrier (x);
                t = w-TWO112[sx];
                math_force_eval (t);
                fesetenv (&env);
@@ -58,7 +58,7 @@ _Float128 __nearbyintl(_Float128 x)
            else return x;              /* x is integral */
        }
        feholdexcept (&env);
-       w = TWO112[sx]+x;
+       w = TWO112[sx] + math_opt_barrier (x);
        t = w-TWO112[sx];
        math_force_eval (t);
        fesetenv (&env);
++++++ nss-compat.patch ++++++
++++ 6745 lines (skipped)

++++++ nsswitch.conf ++++++
--- /var/tmp/diff_new_pack.ZNofEy/_old  2017-10-06 10:53:21.932821499 +0200
+++ /var/tmp/diff_new_pack.ZNofEy/_new  2017-10-06 10:53:21.936820894 +0200
@@ -22,12 +22,9 @@
 # For more information, please read the nsswitch.conf.5 manual page.
 #
 
-# passwd: files nis
-# shadow: files nis
-# group:  files nis
-
-passwd: compat [NOTFOUND=return] files
-group:  compat [NOTFOUND=return] files
+passwd: compat
+group:  compat
+shadow: compat
 
 hosts:         files dns
 networks:      files dns
@@ -37,11 +34,9 @@
 rpc:           files
 ethers:                files
 netmasks:      files
-netgroup:      files nis
+netgroup:      files
 publickey:     files
 
 bootparams:    files
-automount:     files nis
+automount:     files
 aliases:       files
-
-

++++++ remove-nss-nis-compat.patch ++++++
2017-08-29  Steve Ellcey  <[email protected]>

        * grp/initgroups.c: Include config.h.
        (DEFAULT_CONFIG): New macro.
        (internal_getgrouplist): Use DEFAULT_CONFIG.
        * nscd/initgrcache.c (addinitgroupsX): Likewise.
        * nss/nsswitch.c (__nss_disable_nscd): Likewise.
        (DEFAULT_DEFCONFIG): New macro.
        (__nss_database_lookup): Use DEFAULT_DEFCONFIG.
        * nss/grp-lookup.c: Include config.h
        (DEFAULT_CONFIG): Set definition based on LINK_OBSOLETE_NSL.
        * nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise.
        * nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise.
        * manual/nss.texi: Update default values section.


Index: glibc-2.26/grp/initgroups.c
===================================================================
--- glibc-2.26.orig/grp/initgroups.c
+++ glibc-2.26/grp/initgroups.c
@@ -26,10 +26,16 @@
 #include <sys/types.h>
 #include <nsswitch.h>
 #include <scratch_buffer.h>
+#include <config.h>
 
 #include "../nscd/nscd-client.h"
 #include "../nscd/nscd_proto.h"
 
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
 
 /* Type of the lookup function.  */
 typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
@@ -84,7 +90,7 @@ internal_getgrouplist (const char *user,
                                 &__nss_initgroups_database) < 0)
        {
          if (__nss_group_database == NULL)
-           no_more = __nss_database_lookup ("group", NULL, "compat files",
+           no_more = __nss_database_lookup ("group", NULL, DEFAULT_CONFIG,
                                             &__nss_group_database);
 
          __nss_initgroups_database = __nss_group_database;
Index: glibc-2.26/manual/nss.texi
===================================================================
--- glibc-2.26.orig/manual/nss.texi
+++ glibc-2.26/manual/nss.texi
@@ -318,13 +318,17 @@ The @code{passwd}, @code{group}, and @co
 traditionally handled in a special way.  The appropriate files in the
 @file{/etc} directory are read but if an entry with a name starting
 with a @code{+} character is found NIS is used.  This kind of lookup
-remains possible by using the special lookup service @code{compat}
-and the default value for the three databases above is
-@code{compat [NOTFOUND=return] files}.
+remains possible if @theglibc{} was configured with the
+@code{--enable-obsolete-nsl} option and the special lookup service
+@code{compat} is used.  If @theglibc{} was configured with the
+@code{--enable-obsolete-nsl} option the default value for the three
+databases above is @code{compat [NOTFOUND=return] files}.  If the
+@code{--enable-obsolete-nsl} option was not used the default value
+for the services is @code{files}.
 
-For all other databases the default value is
-@code{nis [NOTFOUND=return] files}.  This solution gives the best
-chance to be correct since NIS and file based lookups are used.
+For all other databases the default value is @code{files} unless
+@theglibc{} was configured with @code{--enable-obsolete-rpc} option, in
+which case it the default value is @code{nis [NOTFOUND=return] files}.
 
 @cindex optimizing NSS
 A second point is that the user should try to optimize the lookup
Index: glibc-2.26/nscd/initgrcache.c
===================================================================
--- glibc-2.26.orig/nscd/initgrcache.c
+++ glibc-2.26/nscd/initgrcache.c
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <sys/mman.h>
 #include <scratch_buffer.h>
+#include <config.h>
 
 #include "dbg_log.h"
 #include "nscd.h"
@@ -34,6 +35,11 @@
 
 #include "../nss/nsswitch.h"
 
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
 
 /* Type of the lookup function.  */
 typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
@@ -85,8 +91,7 @@ addinitgroupsX (struct database_dyn *db,
   int no_more;
 
   if (group_database == NULL)
-    no_more = __nss_database_lookup ("group", NULL,
-                                    "compat [NOTFOUND=return] files",
+    no_more = __nss_database_lookup ("group", NULL, DEFAULT_CONFIG,
                                     &group_database);
   else
     no_more = 0;
Index: glibc-2.26/nss/grp-lookup.c
===================================================================
--- glibc-2.26.orig/nss/grp-lookup.c
+++ glibc-2.26/nss/grp-lookup.c
@@ -16,7 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #define DATABASE_NAME group
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
 
 #include "XXX-lookup.c"
Index: glibc-2.26/nss/nsswitch.c
===================================================================
--- glibc-2.26.orig/nss/nsswitch.c
+++ glibc-2.26/nss/nsswitch.c
@@ -40,6 +40,15 @@
 #include "nsswitch.h"
 #include "../nscd/nscd_proto.h"
 #include <sysdep.h>
+#include <config.h>
+
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+# define DEFAULT_DEFCONFIG "nis [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+# define DEFAULT_DEFCONFIG "files"
+#endif
 
 /* Prototypes for the local functions.  */
 static name_database *nss_parse_file (const char *fname) internal_function;
@@ -151,8 +160,7 @@ __nss_database_lookup (const char *datab
      or null to use the most common default.  */
   if (*ni == NULL)
     {
-      *ni = nss_parse_service_list (defconfig
-                                   ?: "nis [NOTFOUND=return] files");
+      *ni = nss_parse_service_list (defconfig ?: DEFAULT_DEFCONFIG);
       if (*ni != NULL)
        {
          /* Record the memory we've just allocated in defconfig_entries list,
@@ -848,8 +856,8 @@ __nss_disable_nscd (void (*cb) (size_t,
   is_nscd = true;
 
   /* Find all the relevant modules so that the init functions are called.  */
-  nss_load_all_libraries ("passwd", "compat [NOTFOUND=return] files");
-  nss_load_all_libraries ("group", "compat [NOTFOUND=return] files");
+  nss_load_all_libraries ("passwd", DEFAULT_CONFIG);
+  nss_load_all_libraries ("group", DEFAULT_CONFIG);
   nss_load_all_libraries ("hosts", "dns [!UNAVAIL=return] files");
   nss_load_all_libraries ("services", NULL);
 
Index: glibc-2.26/nss/pwd-lookup.c
===================================================================
--- glibc-2.26.orig/nss/pwd-lookup.c
+++ glibc-2.26/nss/pwd-lookup.c
@@ -16,7 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #define DATABASE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
 
 #include "XXX-lookup.c"
Index: glibc-2.26/nss/spwd-lookup.c
===================================================================
--- glibc-2.26.orig/nss/spwd-lookup.c
+++ glibc-2.26/nss/spwd-lookup.c
@@ -16,8 +16,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #define DATABASE_NAME shadow
 #define ALTERNATE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
 
 #include "XXX-lookup.c"
++++++ resolv-conf-oom.patch ++++++
2017-09-06  Florian Weimer  <[email protected]>

        [BZ #22096]
        * resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in
        case of failure to obtain the global conf object.

2017-09-06  Florian Weimer  <[email protected]>

        [BZ #22095]
        * resolv/res_init.c (res_vinit_1): Avoid memory leak in case of
        dynarray allocation failure.

Index: glibc-2.26/resolv/res_init.c
===================================================================
--- glibc-2.26.orig/resolv/res_init.c
+++ glibc-2.26/resolv/res_init.c
@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_con
                     (&parser->nameserver_list);
                   if (p != NULL)
                     *p = sa;
+                  else
+                    {
+                      free (sa);
+                      return false;
+                    }
                 }
               continue;
             }
Index: glibc-2.26/resolv/resolv_conf.c
===================================================================
--- glibc-2.26.orig/resolv/resolv_conf.c
+++ glibc-2.26/resolv/resolv_conf.c
@@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state
 
   struct resolv_conf_global *global_copy = get_locked_global ();
   if (global_copy == NULL)
-    {
-      free (conf);
-      return false;
-    }
+    return false;
 
   /* Try to find an unused index in the array.  */
   size_t index;

Reply via email to