forked from rpms/glibc
1708d98eba
* Mon Nov 14 2022 Arjun Shankar <arjun@redhat.com> - 2.34-49 - Sync with upstream branch release/2.34/master, commit: 75b0edb7ef338084e53925139ae81fb0dfc07dd4: - Update NEWS file in the right place - Linux: Support __IPC_64 in sysvctl *ctl command arguments (bug 29771) - io: Fix use-after-free in ftw [BZ #26779] - io: Fix ftw internal realloc buffer (BZ #28126) - regex: fix buffer read overrun in search [BZ#28470] - regex: copy back from Gnulib - Allow #pragma GCC in headers in conformtest - Fix memmove call in vfprintf-internal.c:group_number - mktime: improve heuristic for ca-1986 Indiana DST - Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564] - linux: Fix generic struct_stat for 64 bit time (BZ# 29657) - elf: Do not completely clear reused namespace in dlmopen (bug 29600) - nss: Use shared prefix in IPv4 address in tst-reload1 - nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816) - nss: Implement --no-addrconfig option for getent Resolves: #2141728 Resolves: #2110357 Resolves: #2141685
39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
commit 16c7ed6e68c13e5a5efd8ab464ebf9d07b4b0bb3
|
|
Author: Florian Weimer <fweimer@redhat.com>
|
|
Date: Tue Sep 13 16:11:40 2022 +0200
|
|
|
|
nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816)
|
|
|
|
getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default.
|
|
Use --no-addrconfig to suppress that, so that both IPv4 and IPv6
|
|
lookups succeed even if the address family is not supported by the
|
|
host.
|
|
|
|
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
(cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00)
|
|
|
|
diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c
|
|
index 00f8bea409e0b4cb..42676ba4056dbde2 100644
|
|
--- a/nss/tst-nss-files-hosts-long.c
|
|
+++ b/nss/tst-nss-files-hosts-long.c
|
|
@@ -28,14 +28,15 @@ do_test (void)
|
|
{
|
|
int ret;
|
|
|
|
- /* Run getent to fetch the IPv4 address for host test4.
|
|
- This forces /etc/hosts to be parsed. */
|
|
- ret = system("getent ahostsv4 test4");
|
|
+ /* Run getent to fetch the IPv4 address for host test4. This forces
|
|
+ /etc/hosts to be parsed. Use --no-addrconfig to return addresses
|
|
+ even in an IPv6-only environment. */
|
|
+ ret = system("getent --no-addrconfig ahostsv4 test4");
|
|
if (ret != 0)
|
|
FAIL_EXIT1("ahostsv4 failed");
|
|
|
|
/* Likewise for IPv6. */
|
|
- ret = system("getent ahostsv6 test6");
|
|
+ ret = system("getent --no-addrconfig ahostsv6 test6");
|
|
if (ret != 0)
|
|
FAIL_EXIT1("ahostsv6 failed");
|
|
|