diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-09-01 09:15:36 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-09-01 09:15:36 +0200 |
commit | 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d (patch) | |
tree | b2ee97df516444f2077b4a10bc1b44475ee97382 | |
parent | 65329bd233db9d1b8b94e90734a564705b619260 (diff) | |
download | glibc-5f8340f583fe3d4f5734bd2371c5a45ecff2db0d.zip glibc-5f8340f583fe3d4f5734bd2371c5a45ecff2db0d.tar.gz glibc-5f8340f583fe3d4f5734bd2371c5a45ecff2db0d.tar.bz2 |
getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922]
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 8 |
2 files changed, 14 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2017-09-01 Florian Weimer <fweimer@redhat.com> + [BZ #21922] + * sysdeps/posix/getaddrinfo.c (gaih_inet): Report EAI_NODATA error + coming from gethostbyname2_r. + +2017-09-01 Florian Weimer <fweimer@redhat.com> + * support/namespace.h (struct support_chroot_configuration): Add hosts, host_conf. (struct support_chroot): Add path_hosts, path_host_conf. diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index acb5d9e..0471a2f 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -618,6 +618,14 @@ gaih_inet (const char *name, const struct gaih_service *service, } *pat = addrmem; } + else + { + if (h_errno == NO_DATA) + result = -EAI_NODATA; + else + result = -EAI_NONAME; + goto free_and_return; + } } else { |