- h = gethostbyaddr( (char *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
- if (!h) {
-#ifdef h_errno
- Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\": %s!", inet_ntoa( Addr->sin_addr ), Get_Error( h_errno ));
-#else
- Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\"!", inet_ntoa( Addr->sin_addr ));
-#endif
- strlcpy( hostname, inet_ntoa( Addr->sin_addr ), sizeof( hostname ));
- } else {
- strlcpy( hostname, h->h_name, sizeof( hostname ));
-
- h = gethostbyname( hostname );
- if ( h ) {
- if (memcmp(h->h_addr, &Addr->sin_addr, sizeof (struct in_addr))) {
- addr = (struct in_addr*) h->h_addr;
- strlcpy(ipstr, inet_ntoa(*addr), sizeof ipstr);
- ntoaptr = inet_ntoa( Addr->sin_addr );
- Log(LOG_WARNING,"Possible forgery: %s resolved to %s (which is at ip %s!)",
- ntoaptr, hostname, ipstr);
- strlcpy( hostname, ntoaptr, sizeof hostname);
- }
- } else {
- ntoaptr = inet_ntoa( Addr->sin_addr );
- Log(LOG_WARNING, "Possible forgery: %s resolved to %s (which has no ip address)",
- ntoaptr, hostname);
- strlcpy( hostname, ntoaptr, sizeof hostname);
- }
- }
- Log_Resolver( LOG_DEBUG, "Ok, translated %s to \"%s\".", inet_ntoa( Addr->sin_addr ), hostname );
-
- /* Write resolver result into pipe to parent */
- len = strlen( hostname );
- hostname[len] = '\n'; len++;
- if( (size_t)write( w_fd, hostname, len ) != (size_t)len )
- {
- Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
- close( w_fd );
+ res = ident_id( identsock, 10 );
+#ifdef DEBUG
+ Log_Subprocess(LOG_DEBUG, "Ok, IDENT lookup on socket %d done: \"%s\"",
+ identsock, res ? res : "(NULL)");
+#endif
+ if (!res) /* no result */