]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nss-resolve: report EAI_NODATA
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Wed, 17 May 2023 15:55:42 +0000 (17:55 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 May 2023 08:57:06 +0000 (17:57 +0900)
src/nss-resolve/nss-resolve.c

index 02267522759de0252d9e82dffe188859da5df31b..89381f56031a6e301f435756f118034e5ed7af7f 100644 (file)
@@ -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;