This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]