diff options
Diffstat (limited to 'src/nss-mymachines')
-rw-r--r-- | src/nss-mymachines/nss-mymachines.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 2d3e54210c..5327499957 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -131,7 +131,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r( goto fail; if (c <= 0) { - *errnop = ENOENT; + *errnop = ESRCH; *h_errnop = HOST_NOT_FOUND; return NSS_STATUS_NOTFOUND; } @@ -140,7 +140,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r( ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * c; if (buflen < ms) { *errnop = ENOMEM; - *h_errnop = NO_RECOVERY; + *h_errnop = TRY_AGAIN; return NSS_STATUS_TRYAGAIN; } @@ -168,6 +168,11 @@ enum nss_status _nss_mymachines_gethostbyname4_r( if (r < 0) goto fail; + if (!IN_SET(family, AF_INET, AF_INET6)) { + r = -EAFNOSUPPORT; + goto fail; + } + if (sz != PROTO_ADDRESS_SIZE(family)) { r = -EINVAL; goto fail; |