From 94f3329f31fa6f71a1aebe0711c49bd8ebd6508d Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Tue, 23 Aug 2022 02:57:28 +0000 Subject: log a warning if we can't resolve the ldap server hostname --- usr.sbin/ypldap/ypldap_dns.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'usr.sbin/ypldap') 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 @@ -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); } -- cgit v1.2.3