[PATCH] getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922]

Florian Weimer fweimer@redhat.com
Thu Aug 31 09:55:00 GMT 2017


On 08/08/2017 07:01 PM, Florian Weimer wrote:
> 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.
> 
> 2017-08-08  Florian Weimer  <fweimer@redhat.com>
> 
> 	[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.

Ping?  I'd really like to have a second take on this patch and its
precursors.

  <https://sourceware.org/ml/libc-alpha/2017-08/msg00292.html>

Thanks,
Florian



More information about the Libc-alpha mailing list