forked from rpms/glibc
c2879fd933
* Thu Jan 13 2022 Florian Weimer <fweimer@redhat.com> - 2.34-18 - Backport optimized ELF dependency sorting algorithm (#2032647) * Thu Jan 13 2022 Florian Weimer <fweimer@redhat.com> - 2.34-17 - Sync with upstream branch release/2.34/master, commit 2fe2af88abd13ae5636881da2e26f461ecb7dfb5 - i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771) - Update syscall lists for Linux 5.15 - powerpc: Fix unrecognized instruction errors with recent GCC - timezone: test-case for BZ #28707 - timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707) - Fix subscript error with odd TZif file [BZ #28338] - AArch64: Check for SVE in ifuncs [BZ #28744] - intl/plural.y: Avoid conflicting declarations of yyerror and yylex - Linux: Fix 32-bit vDSO for clock_gettime on powerpc32 - linux: Add sparck brk implementation - Update sparc libm-test-ulps - Update hppa libm-test-ulps - riscv: align stack before calling _dl_init [BZ #28703] - riscv: align stack in clone [BZ #28702] - powerpc64[le]: Allocate extra stack frame on syscall.S - elf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704] - nss: Use "files dns" as the default for the hosts database (bug 28700) - arm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro - mips: increase stack alignment in clone to match the ABI - mips: align stack in clone [BZ #28223] Resolves: #2032647 Resolves: #2033649
75 lines
3.1 KiB
Diff
75 lines
3.1 KiB
Diff
commit dc9b69d5331dcdca4547c0490cb9fefbd89e40f6
|
|
Author: Florian Weimer <fweimer@redhat.com>
|
|
Date: Fri Dec 17 12:01:20 2021 +0100
|
|
|
|
nss: Use "files dns" as the default for the hosts database (bug 28700)
|
|
|
|
This matches what is currently in nss/nsswitch.conf. The new ordering
|
|
matches what most distributions use in their installed configuration
|
|
files.
|
|
|
|
It is common to add localhost to /etc/hosts because the name does not
|
|
exist in the DNS, but is commonly used as a host name.
|
|
|
|
With the built-in "dns [!UNAVAIL=return] files" default, dns is
|
|
searched first and provides an answer for "localhost" (NXDOMAIN).
|
|
We never look at the files database as a result, so the contents of
|
|
/etc/hosts is ignored. This means that "getent hosts localhost"
|
|
fail without a /etc/nsswitch.conf file, even though the host name
|
|
is listed in /etc/hosts.
|
|
|
|
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
(cherry picked from commit b99b0f93ee8762fe53ff65802deb6f00700b9924)
|
|
|
|
diff --git a/manual/nss.texi b/manual/nss.texi
|
|
index 3aaa7786f8cf3168..524d22ad1e7f8ca0 100644
|
|
--- a/manual/nss.texi
|
|
+++ b/manual/nss.texi
|
|
@@ -324,9 +324,8 @@ missing.
|
|
|
|
@cindex default value, and NSS
|
|
For the @code{hosts} and @code{networks} databases the default value is
|
|
-@code{dns [!UNAVAIL=return] files}. I.e., the system is prepared for
|
|
-the DNS service not to be available but if it is available the answer it
|
|
-returns is definitive.
|
|
+@code{files dns}. I.e., local configuration will override the contents
|
|
+of the domain name system (DNS).
|
|
|
|
The @code{passwd}, @code{group}, and @code{shadow} databases was
|
|
traditionally handled in a special way. The appropriate files in the
|
|
diff --git a/nss/XXX-lookup.c b/nss/XXX-lookup.c
|
|
index f1c97f7c8e9d7378..dbc87868dd408d9f 100644
|
|
--- a/nss/XXX-lookup.c
|
|
+++ b/nss/XXX-lookup.c
|
|
@@ -29,7 +29,7 @@
|
|
|* ALTERNATE_NAME - name of another service which is examined in *|
|
|
|* case DATABASE_NAME is not found *|
|
|
|* *|
|
|
-|* DEFAULT_CONFIG - string for default conf (e.g. "dns files") *|
|
|
+|* DEFAULT_CONFIG - string for default conf (e.g. "files dns") *|
|
|
|* *|
|
|
\*******************************************************************/
|
|
|
|
diff --git a/nss/nss_database.c b/nss/nss_database.c
|
|
index ab121cb371c087e9..54561f03287db2e4 100644
|
|
--- a/nss/nss_database.c
|
|
+++ b/nss/nss_database.c
|
|
@@ -80,7 +80,7 @@ enum nss_database_default
|
|
{
|
|
nss_database_default_defconfig = 0, /* "nis [NOTFOUND=return] files". */
|
|
nss_database_default_compat, /* "compat [NOTFOUND=return] files". */
|
|
- nss_database_default_dns, /* "dns [!UNAVAIL=return] files". */
|
|
+ nss_database_default_dns, /* "files dns". */
|
|
nss_database_default_files, /* "files". */
|
|
nss_database_default_nis, /* "nis". */
|
|
nss_database_default_nis_nisplus, /* "nis nisplus". */
|
|
@@ -133,7 +133,7 @@ nss_database_select_default (struct nss_database_default_cache *cache,
|
|
#endif
|
|
|
|
case nss_database_default_dns:
|
|
- line = "dns [!UNAVAIL=return] files";
|
|
+ line = "files dns";
|
|
break;
|
|
|
|
case nss_database_default_files:
|