summaryrefslogtreecommitdiff
path: root/usr.sbin/ypldap
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2022-08-23 02:57:28 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2022-08-23 02:57:28 +0000
commit94f3329f31fa6f71a1aebe0711c49bd8ebd6508d (patch)
tree45ef346b08eb22dcf21db11fa71b716ffec4021f /usr.sbin/ypldap
parent8e852484aff4ad877e571db3827ed28736400f94 (diff)
log a warning if we can't resolve the ldap server hostname
Diffstat (limited to 'usr.sbin/ypldap')
-rw-r--r--usr.sbin/ypldap/ypldap_dns.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ypldap/ypldap_dns.c b/usr.sbin/ypldap/ypldap_dns.c
index 6c3ac0e2bc4..59835a80e5c 100644
--- a/usr.sbin/ypldap/ypldap_dns.c
+++ b/usr.sbin/ypldap/ypldap_dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypldap_dns.c,v 1.14 2021/10/09 18:43:50 deraadt Exp $ */
+/* $OpenBSD: ypldap_dns.c,v 1.15 2022/08/23 02:57:27 jmatthew Exp $ */
/*
* Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
@@ -217,11 +217,12 @@ host_dns(const char *s, struct ypldap_addr_list *hn)
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
error = getaddrinfo(s, NULL, &hints, &res0);
- if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME)
- return (0);
- if (error) {
- log_warnx("could not parse \"%s\": %s", s,
+ if (error != 0) {
+ log_warnx("could not resolve \"%s\": %s", s,
gai_strerror(error));
+ if (error == EAI_AGAIN || error == EAI_NODATA ||
+ error == EAI_NONAME)
+ return (0);
return (-1);
}