summaryrefslogtreecommitdiffstats
path: root/src/nss-resolve
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-08-22 18:48:43 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-08-24 19:48:26 +0200
commit8e34f4cc62aaeaa8881a1d6cd9136de5a22777a1 (patch)
treedd505834af7a39e62698dbce2d851cca51a0ab05 /src/nss-resolve
parentvarious: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN (diff)
downloadsystemd-8e34f4cc62aaeaa8881a1d6cd9136de5a22777a1.tar.xz
systemd-8e34f4cc62aaeaa8881a1d6cd9136de5a22777a1.zip
nss-resolve: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN too
Seems safer to do so.
Diffstat (limited to 'src/nss-resolve')
-rw-r--r--src/nss-resolve/nss-resolve.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c
index 43ab521635..a3416c83c8 100644
--- a/src/nss-resolve/nss-resolve.c
+++ b/src/nss-resolve/nss-resolve.c
@@ -23,12 +23,14 @@ NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
static bool bus_error_shall_fallback(sd_bus_error *e) {
- return sd_bus_error_has_name(e, SD_BUS_ERROR_SERVICE_UNKNOWN) ||
- sd_bus_error_has_name(e, SD_BUS_ERROR_NAME_HAS_NO_OWNER) ||
- sd_bus_error_has_name(e, SD_BUS_ERROR_NO_REPLY) ||
- sd_bus_error_has_name(e, SD_BUS_ERROR_ACCESS_DENIED) ||
- sd_bus_error_has_name(e, SD_BUS_ERROR_DISCONNECTED) ||
- sd_bus_error_has_name(e, SD_BUS_ERROR_TIMEOUT);
+ return sd_bus_error_has_names(e,
+ SD_BUS_ERROR_SERVICE_UNKNOWN,
+ SD_BUS_ERROR_NAME_HAS_NO_OWNER,
+ SD_BUS_ERROR_NO_REPLY,
+ SD_BUS_ERROR_ACCESS_DENIED,
+ SD_BUS_ERROR_DISCONNECTED,
+ SD_BUS_ERROR_TIMEOUT,
+ BUS_ERROR_NO_SUCH_UNIT);
}
static int count_addresses(sd_bus_message *m, int af, const char **canonical) {