ftpd - Logging and resolving IP

pluknet pluknet at gmail.com
Mon Jul 20 15:03:10 UTC 2009


2009/7/20 Cristiano Deana <cristiano.deana at gmail.com>:
> Hi,
>
> i use ftpd (base system), logging login, xfer, auth failure. What i
> need is to log the IP address of the client, not the hostname.
> I looked in ftpd(8) ma it seems it's not possible to disable the
> reverse resolution.
>
> Any idea?
>
> Thanks in advance
>

I hope it's still applicable.

--- libexec/tftpd/tftpd.c.orig  2007-11-09 06:13:22.000000000 +0300
+++ libexec/tftpd/tftpd.c       2007-11-09 06:13:49.000000000 +0300
@@ -487,7 +487,7 @@
                char hbuf[NI_MAXHOST];

                getnameinfo((struct sockaddr *)&from, from.ss_len,
-                           hbuf, sizeof(hbuf), NULL, 0, 0);
+                           hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST);
                syslog(LOG_INFO, "%s: %s request for %s: %s", hbuf,
                        tp->th_opcode == WRQ ? "write" : "read",
                        filename, errtomsg(ecode));

-- 
wbr,
pluknet


More information about the freebsd-questions mailing list