On Sun, Jun 08, 2003 at 10:48:39AM -0700, Todd A. Jacobs wrote:
> I thought tcpwrappers supported hostnames. Are you saying that nessus
> reads hosts.allow/hosts.deny, but doesn't really use the tcpwrappers
> library to grant access? I'm not a C programmer, but nessusd.c includes
> tcpd.h which has structures for supporting hostnames as well as IP
> addresses.
nessusd uses host_ctl(), and it's up to it to provide the FQDN of the
host and its IP address. I originally did not do the reverse lookup as
it may slow things down.
Anyway, here's the (untested) patch :
Index: nessusd.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/nessusd.c,v
retrieving revision 1.216
diff -r1.216 nessusd.c
794c794,798
< if(!(hosts_ctl("nessusd", STRING_UNKNOWN, asciiaddr, STRING_UNKNOWN)))
---
> {
> char host_name[1024];
>
> hg_get_name_from_ip(addr.sin_addr, host_name, sizeof(host_name));
> if(!(hosts_ctl("nessusd", host_name, asciiaddr, STRING_UNKNOWN)))
799a804
> }