diff --git a/eh-frame-zero-terminator.patch b/eh-frame-zero-terminator.patch new file mode 100644 index 0000000..28a4c16 --- /dev/null +++ b/eh-frame-zero-terminator.patch @@ -0,0 +1,31 @@ +2017-08-31 H.J. Lu + + [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 diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index f8c1b5d..aaeae73 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Tue Sep 12 06:37:36 UTC 2017 - schwab@suse.de + +- Remove rpcsvc/yppasswd.* from glibc-devel +- ld-so-hwcap-x86-64.patch: add x86_64 to hwcap (BZ #22093, bsc#1056606) + +------------------------------------------------------------------- +Thu Aug 31 13:43:07 UTC 2017 - schwab@suse.de + +- eh-frame-zero-terminator.patch: Properly terminate .eh_frame (BZ #22051) + +------------------------------------------------------------------- +Thu Aug 31 07:06:20 UTC 2017 - schwab@suse.de + +- Disable obsolete libnsl and NIS support +- remove-nss-nis-compat.patch: remove nis and compat from default NSS + configs +- nsswitch.conf: Likewise + ------------------------------------------------------------------- Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 54d1bef..8bf4b0d 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -277,6 +277,12 @@ Patch1001: dl-runtime-resolve-opt-avx512f.patch 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 ### # Patches awaiting upstream approval @@ -510,6 +516,9 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 +%patch1005 -p1 +%patch1006 -p1 %patch2000 -p1 %patch2001 -p1 @@ -677,7 +686,7 @@ configure_and_build_glibc() { --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 +778,6 @@ pushd crypt_blowfish-%{crypt_bf_version} make man popd -####################################################################### -### -### CHECK -### -####################################################################### - %check %if %{build_testsuite} # The testsuite will fail if asneeded is used @@ -916,6 +919,11 @@ export RPM_BUILD_ROOT 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} @@ -1192,8 +1200,6 @@ exit 0 %endif /%{_lib}/libnsl-%{libversion}.so /%{_lib}/libnsl.so.1 -/%{_lib}/libnss_compat-%{libversion}.so -/%{_lib}/libnss_compat.so.2 /%{_lib}/libnss_db-%{libversion}.so /%{_lib}/libnss_db.so.2 /%{_lib}/libnss_dns-%{libversion}.so @@ -1202,10 +1208,6 @@ exit 0 /%{_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 +1320,6 @@ exit 0 %{_libdir}/libm-%{libversion}.a %{_libdir}/libmvec.a %endif -%{_libdir}/libnsl.a %{_libdir}/libpthread.a %{_libdir}/libresolv.a %{_libdir}/librt.a @@ -1374,7 +1375,6 @@ exit 0 %{_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 diff --git a/glibc-utils.changes b/glibc-utils.changes index f8c1b5d..aaeae73 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Tue Sep 12 06:37:36 UTC 2017 - schwab@suse.de + +- Remove rpcsvc/yppasswd.* from glibc-devel +- ld-so-hwcap-x86-64.patch: add x86_64 to hwcap (BZ #22093, bsc#1056606) + +------------------------------------------------------------------- +Thu Aug 31 13:43:07 UTC 2017 - schwab@suse.de + +- eh-frame-zero-terminator.patch: Properly terminate .eh_frame (BZ #22051) + +------------------------------------------------------------------- +Thu Aug 31 07:06:20 UTC 2017 - schwab@suse.de + +- Disable obsolete libnsl and NIS support +- remove-nss-nis-compat.patch: remove nis and compat from default NSS + configs +- nsswitch.conf: Likewise + ------------------------------------------------------------------- Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index a01e197..865f2a1 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -277,6 +277,12 @@ Patch1001: dl-runtime-resolve-opt-avx512f.patch 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 ### # Patches awaiting upstream approval @@ -510,6 +516,9 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 +%patch1005 -p1 +%patch1006 -p1 %patch2000 -p1 %patch2001 -p1 @@ -677,7 +686,7 @@ configure_and_build_glibc() { --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 +778,6 @@ pushd crypt_blowfish-%{crypt_bf_version} make man popd -####################################################################### -### -### CHECK -### -####################################################################### - %check %if %{build_testsuite} # The testsuite will fail if asneeded is used @@ -916,6 +919,11 @@ export RPM_BUILD_ROOT 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} @@ -1192,8 +1200,6 @@ exit 0 %endif /%{_lib}/libnsl-%{libversion}.so /%{_lib}/libnsl.so.1 -/%{_lib}/libnss_compat-%{libversion}.so -/%{_lib}/libnss_compat.so.2 /%{_lib}/libnss_db-%{libversion}.so /%{_lib}/libnss_db.so.2 /%{_lib}/libnss_dns-%{libversion}.so @@ -1202,10 +1208,6 @@ exit 0 /%{_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 +1320,6 @@ exit 0 %{_libdir}/libm-%{libversion}.a %{_libdir}/libmvec.a %endif -%{_libdir}/libnsl.a %{_libdir}/libpthread.a %{_libdir}/libresolv.a %{_libdir}/librt.a @@ -1374,7 +1375,6 @@ exit 0 %{_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 diff --git a/glibc.changes b/glibc.changes index f8c1b5d..aaeae73 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Tue Sep 12 06:37:36 UTC 2017 - schwab@suse.de + +- Remove rpcsvc/yppasswd.* from glibc-devel +- ld-so-hwcap-x86-64.patch: add x86_64 to hwcap (BZ #22093, bsc#1056606) + +------------------------------------------------------------------- +Thu Aug 31 13:43:07 UTC 2017 - schwab@suse.de + +- eh-frame-zero-terminator.patch: Properly terminate .eh_frame (BZ #22051) + +------------------------------------------------------------------- +Thu Aug 31 07:06:20 UTC 2017 - schwab@suse.de + +- Disable obsolete libnsl and NIS support +- remove-nss-nis-compat.patch: remove nis and compat from default NSS + configs +- nsswitch.conf: Likewise + ------------------------------------------------------------------- Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index b0dbb5d..1ab4931 100644 --- a/glibc.spec +++ b/glibc.spec @@ -283,6 +283,12 @@ Patch1001: dl-runtime-resolve-opt-avx512f.patch 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 ### # Patches awaiting upstream approval @@ -516,6 +522,9 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 +%patch1005 -p1 +%patch1006 -p1 %patch2000 -p1 %patch2001 -p1 @@ -683,7 +692,7 @@ configure_and_build_glibc() { --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 +784,6 @@ pushd crypt_blowfish-%{crypt_bf_version} make man popd -####################################################################### -### -### CHECK -### -####################################################################### - %check %if %{build_testsuite} # The testsuite will fail if asneeded is used @@ -922,6 +925,11 @@ export RPM_BUILD_ROOT 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} @@ -1198,8 +1206,6 @@ exit 0 %endif /%{_lib}/libnsl-%{libversion}.so /%{_lib}/libnsl.so.1 -/%{_lib}/libnss_compat-%{libversion}.so -/%{_lib}/libnss_compat.so.2 /%{_lib}/libnss_db-%{libversion}.so /%{_lib}/libnss_db.so.2 /%{_lib}/libnss_dns-%{libversion}.so @@ -1208,10 +1214,6 @@ exit 0 /%{_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 +1326,6 @@ exit 0 %{_libdir}/libm-%{libversion}.a %{_libdir}/libmvec.a %endif -%{_libdir}/libnsl.a %{_libdir}/libpthread.a %{_libdir}/libresolv.a %{_libdir}/librt.a @@ -1380,7 +1381,6 @@ exit 0 %{_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 diff --git a/ld-so-hwcap-x86-64.patch b/ld-so-hwcap-x86-64.patch new file mode 100644 index 0000000..b99547a --- /dev/null +++ b/ld-so-hwcap-x86-64.patch @@ -0,0 +1,190 @@ +2017-09-11 H.J. Lu + + [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 ++ . */ ++ ++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 ++ . */ ++ ++void ++foo (void) ++{ ++} diff --git a/nsswitch.conf b/nsswitch.conf index fbd63fd..fcf5e1a 100644 --- a/nsswitch.conf +++ b/nsswitch.conf @@ -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: files +group: files +shadow: files hosts: files dns networks: files dns @@ -37,11 +34,9 @@ protocols: files rpc: files ethers: files netmasks: files -netgroup: files nis +netgroup: files publickey: files bootparams: files -automount: files nis +automount: files aliases: files - - diff --git a/remove-nss-nis-compat.patch b/remove-nss-nis-compat.patch new file mode 100644 index 0000000..4a78c5c --- /dev/null +++ b/remove-nss-nis-compat.patch @@ -0,0 +1,207 @@ +2017-08-29 Steve Ellcey + + * 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 + #include + #include ++#include + + #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 + #include + #include ++#include + + #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 + . */ + ++#include ++ + #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 ++#include ++ ++#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 + . */ + ++#include ++ + #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 + . */ + ++#include ++ + #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"