From f4a6be2582b8dfe8adfa68da3dd8decf566b3983 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 1 Sep 2017 09:34:29 +0200 Subject: getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922] The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable. --- ChangeLog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 2cb929635a..785b7e9e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2017-09-01 Florian Weimer + + [BZ #21915] + [BZ #21922] + * sysdeps/posix/getaddrinfo.c (gethosts): Look at NSS function + result to determine success or failure, not the errno value. + * nss/Makefile (tests): Add tst-nss-files-hosts-erange. + (tst-nss-files-hosts-erange): Link with -ldl. + * nss/tst-nss-files-hosts-erange.c: New file. + * nss/tst-resolv-basic.c (response): Handle nodata.example. + (do_test): Add NO_DATA tests. + * resolv/tst-resolv-basic.c (test_nodata_nxdomain): New function. + (do_test): Call it. + 2017-09-01 Florian Weimer [BZ #21922] -- cgit v1.2.3