summaryrefslogtreecommitdiffstats
path: root/libexec/fingerd
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-02-18 07:08:03 +0000
committershin <shin@FreeBSD.org>2000-02-18 07:08:03 +0000
commiteb6cba145ae2b83af2593a9ff5b8162519c39bac (patch)
tree2550f844dfd73de704ee2f7dd17928152af6ccf5 /libexec/fingerd
parent0dc6c76d540c5048b41f8b402837e6e82ee3dc61 (diff)
downloadFreeBSD-src-eb6cba145ae2b83af2593a9ff5b8162519c39bac.zip
FreeBSD-src-eb6cba145ae2b83af2593a9ff5b8162519c39bac.tar.gz
Support logging for IPv6 remote host.
Approved by: jkh PR: bin/16789 Submitted by: Ben Smithurst <ben@scientia.demon.co.uk
Diffstat (limited to 'libexec/fingerd')
-rw-r--r--libexec/fingerd/fingerd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c
index aa71613..15463e8 100644
--- a/libexec/fingerd/fingerd.c
+++ b/libexec/fingerd/fingerd.c
@@ -70,7 +70,7 @@ main(argc, argv)
register FILE *fp;
register int ch;
register char *lp;
- struct sockaddr_in sin;
+ struct sockaddr_storage ss;
int p[2], logging, secure, sval;
#define ENTRIES 50
char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog;
@@ -127,10 +127,11 @@ main(argc, argv)
for (end = t; *end; end++)
if (*end == '\n' || *end == '\r')
*end = ' ';
- sval = sizeof(sin);
- if (getpeername(0, (struct sockaddr *)&sin, &sval) < 0)
+ sval = sizeof(ss);
+ if (getpeername(0, (struct sockaddr *)&ss, &sval) < 0)
logerr("getpeername: %s", strerror(errno));
- realhostname(rhost, sizeof rhost - 1, &sin.sin_addr);
+ realhostname_sa(rhost, sizeof rhost - 1,
+ (struct sockaddr *)&ss, sval);
rhost[sizeof(rhost) - 1] = '\0';
syslog(LOG_NOTICE, "query from %s: `%s'", rhost, t);
}
OpenPOWER on IntegriCloud