#include "portab.h"
-static char UNUSED id[] = "$Id: resolve.c,v 1.26 2006/12/17 22:50:51 fw Exp $";
+static char UNUSED id[] = "$Id: resolve.c,v 1.28 2008/01/02 11:03:29 fw Exp $";
#include "imp.h"
#include <assert.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include <netdb.h>
#ifdef IDENTAUTH
#include "conn.h"
#include "defines.h"
#include "log.h"
+#include "tool.h"
#include "exp.h"
#include "resolve.h"
/* Resolver sub-process: resolve IP address and write result into
* pipe to parent. */
- char hostname[HOST_LEN];
- char ipstr[HOST_LEN];
+ char hostname[CLIENT_HOST_LEN];
+ char ipstr[CLIENT_HOST_LEN];
struct hostent *h;
size_t len;
struct in_addr *addr;
Log_Resolver( LOG_DEBUG, "Now resolving %s ...", inet_ntoa( Addr->sin_addr ));
#endif
h = gethostbyaddr( (char *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
- if (!h) {
+ if (!h || strlen(h->h_name) >= sizeof(hostname)) {
#ifdef h_errno
Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\": %s!", inet_ntoa( Addr->sin_addr ), Get_Error( h_errno ));
#else