diff --git a/ChangeLog b/ChangeLog index 1164db433b..4a0e91ef9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-06-30 Zineb Zaadoud (tiny change) + + getaddrinfo: Skip when DNS resolution is unavailable + * tests/test-getaddrinfo.c (simple): Skip tests for unavailable DNS. + 2026-06-26 Paul Eggert strfmon_l: be consistent about unsigned vs size_t diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c index 83e52d1091..4070cc2685 100644 --- a/tests/test-getaddrinfo.c +++ b/tests/test-getaddrinfo.c @@ -120,6 +120,16 @@ simple (int pass, char const *host, char const *service) fprintf (stderr, "skipping getaddrinfo test: no network?\n"); return 77; } + + /* EAI_NONAME can be returned in sandboxed build environments where + DNS resolution is unavailable. Treat it like EAI_AGAIN and skip. */ + if (res == EAI_NONAME) + { + skip++; + fprintf (stderr, "skipping getaddrinfo test: no DNS resolver?\n"); + return 77; + } + /* Solaris reports EAI_SERVICE for "http" and "https". Don't fail the test merely because of this. */ if (res == EAI_SERVICE)