diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-04-20 21:04:26 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-04-20 21:04:26 +0000 |
commit | 84280c2f0b779006836e1470ee39e5e67f6661d0 (patch) | |
tree | 14e29faf73bb1e840729c72323cab58896aa5a2d /libexec/ftpd | |
parent | 9a7e5f76abcf270fc2da66872e38e8a213645d2b (diff) |
When receiving a new connection, log the remote IP number
in addition to the remote hostname.
Feature requested by Mark Bucciarelli mkbucc at gmail dot com on misc@.
"seems OK" millert@
Diffstat (limited to 'libexec/ftpd')
-rw-r--r-- | libexec/ftpd/ftpd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 797a3ea0dc7..4001ba597c2 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.185 2008/09/30 16:16:21 deraadt Exp $ */ +/* $OpenBSD: ftpd.c,v 1.186 2009/04/20 21:04:25 schwarze Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -70,7 +70,7 @@ static const char copyright[] = static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94"; #else static const char rcsid[] = - "$OpenBSD: ftpd.c,v 1.185 2008/09/30 16:16:21 deraadt Exp $"; + "$OpenBSD: ftpd.c,v 1.186 2009/04/20 21:04:25 schwarze Exp $"; #endif #endif /* not lint */ @@ -2174,8 +2174,13 @@ dolog(struct sockaddr *sa) setproctitle("%s", proctitle); #endif /* HASSETPROCTITLE */ - if (logging) - syslog(LOG_INFO, "connection from %s", remotehost); + if (logging) { + int error; + error = getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), + NULL, 0, NI_NUMERICHOST); + syslog(LOG_INFO, "connection from %s [%s]", remotehost, + error ? gai_strerror(error) : hbuf); + } } /* |