summaryrefslogtreecommitdiff
path: root/Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch')
-rw-r--r--Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch b/Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch
new file mode 100644
index 0000000..f9cb581
--- /dev/null
+++ b/Fix-failing-nss-tst-nss-files-hosts-long-with-local-.patch
@@ -0,0 +1,37 @@
+From ae925404a10bf0ea63d6e8d41e3821f68b4d776c Mon Sep 17 00:00:00 2001
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Fri, 3 Sep 2021 00:28:14 +0200
+Subject: [PATCH] Fix failing nss/tst-nss-files-hosts-long with local resolver
+
+When a local resolver like unbound is listening on the IPv4 loopback
+address 127.0.0.1, the nss/tst-nss-files-hosts-long test fails. This is
+due to:
+- the default resolver in the absence of resolv.conf being 127.0.0.1
+- the default DNS NSS database configuration in the absence of
+ nsswitch.conf being 'hosts: dns [!UNAVAIL=return] file'
+
+This causes the requests for 'test4' and 'test6' to first be sent to the
+local resolver, which responds with NXDOMAIN in the likely case those
+records do no exist. In turn that causes the access to /etc/hosts to be
+skipped, which is the purpose of that test.
+
+Fix that by providing a simple nsswitch.conf file forcing access to
+/etc/hosts for that test. I have tested that the only changed result in
+the testsuite is that test.
+
+(cherry picked from commit 2738480a4b0866723fb8c633f36bdd34a8767581)
+---
+ nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf | 1 +
+ 1 file changed, 1 insertion(+)
+ create mode 100644 nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
+
+diff --git a/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
+new file mode 100644
+index 0000000..5b0c6a4
+--- /dev/null
++++ b/nss/tst-nss-files-hosts-long.root/etc/nsswitch.conf
+@@ -0,0 +1 @@
++hosts: files
+--
+1.8.3.1
+