version 1.578, 2022/10/13 09:09:28 |
version 1.579, 2022/10/24 22:43:36 |
|
|
resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) |
resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) |
{ |
{ |
char strport[NI_MAXSERV]; |
char strport[NI_MAXSERV]; |
|
const char *errstr = NULL; |
struct addrinfo hints, *res; |
struct addrinfo hints, *res; |
int gaierr; |
int gaierr; |
LogLevel loglevel = SYSLOG_LEVEL_DEBUG1; |
LogLevel loglevel = SYSLOG_LEVEL_DEBUG1; |
|
|
return NULL; |
return NULL; |
} |
} |
if (cname != NULL && res->ai_canonname != NULL) { |
if (cname != NULL && res->ai_canonname != NULL) { |
if (strlcpy(cname, res->ai_canonname, clen) >= clen) { |
if (!valid_domain(res->ai_canonname, 0, &errstr)) { |
|
error("ignoring bad CNAME \"%s\" for host \"%s\": %s", |
|
res->ai_canonname, name, errstr); |
|
} else if (strlcpy(cname, res->ai_canonname, clen) >= clen) { |
error_f("host \"%s\" cname \"%s\" too long (max %lu)", |
error_f("host \"%s\" cname \"%s\" too long (max %lu)", |
name, res->ai_canonname, (u_long)clen); |
name, res->ai_canonname, (u_long)clen); |
if (clen > 0) |
if (clen > 0) |