summaryrefslogtreecommitdiffstats
path: root/src/nss-resolve
diff options
context:
space:
mode:
authorMateusz Poliwczak <mpoliwczak34@gmail.com>2023-05-17 17:55:42 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-05-18 10:57:06 +0200
commitcb4e5d51553172aa72f432651fb78b70a30acb33 (patch)
treea40b70d32f312ec4a153c4c18aaf990e800c694a /src/nss-resolve
parentbusctl: Add space before "tree" paths for copying (diff)
downloadsystemd-cb4e5d51553172aa72f432651fb78b70a30acb33.tar.xz
systemd-cb4e5d51553172aa72f432651fb78b70a30acb33.zip
nss-resolve: report EAI_NODATA
Diffstat (limited to 'src/nss-resolve')
-rw-r--r--src/nss-resolve/nss-resolve.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c
index 0226752275..89381f5603 100644
--- a/src/nss-resolve/nss-resolve.c
+++ b/src/nss-resolve/nss-resolve.c
@@ -269,6 +269,8 @@ enum nss_status _nss_resolve_gethostbyname4_r(
goto try_again;
if (error_shall_fallback(error_id))
goto fail;
+ if (streq(error_id, "io.systemd.Resolve.NoSuchResourceRecord"))
+ goto no_data;
goto not_found;
}
@@ -367,6 +369,10 @@ not_found:
*h_errnop = HOST_NOT_FOUND;
return NSS_STATUS_NOTFOUND;
+no_data:
+ *h_errnop = NO_DATA;
+ return NSS_STATUS_NOTFOUND;
+
try_again:
UNPROTECT_ERRNO;
*errnop = -r;
@@ -425,6 +431,8 @@ enum nss_status _nss_resolve_gethostbyname3_r(
goto try_again;
if (error_shall_fallback(error_id))
goto fail;
+ if (streq(error_id, "io.systemd.Resolve.NoSuchResourceRecord"))
+ goto no_data;
goto not_found;
}
@@ -542,6 +550,10 @@ not_found:
*h_errnop = HOST_NOT_FOUND;
return NSS_STATUS_NOTFOUND;
+no_data:
+ *h_errnop = NO_DATA;
+ return NSS_STATUS_NOTFOUND;
+
try_again:
UNPROTECT_ERRNO;
*errnop = -r;