From ben@scientia.demon.co.uk  Thu Feb 17 09:56:30 2000
Return-Path: <ben@scientia.demon.co.uk>
Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13])
	by hub.freebsd.org (Postfix) with ESMTP id F075337B6F8
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Feb 2000 09:56:18 -0800 (PST)
	(envelope-from ben@scientia.demon.co.uk)
Received: from platinum.scientia.demon.co.uk ([192.168.91.38] ident=exim)
	by scientia.demon.co.uk with esmtp (Exim 3.12 #1)
	id 12LUWR-000NCf-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 17 Feb 2000 17:15:23 +0000
Received: (from ben) by platinum.scientia.demon.co.uk (Exim 3.12 #7)
	id 12LUWR-0001dk-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 17 Feb 2000 17:15:23 +0000
Message-Id: <E12LUWR-0001dk-00@platinum.scientia.demon.co.uk>
Date: Thu, 17 Feb 2000 17:15:23 +0000
From: Ben Smithurst <ben@scientia.demon.co.uk>
Reply-To: ben@scientia.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: fingerd logging not IPv6 aware
X-Send-Pr-Version: 3.2

>Number:         16789
>Category:       bin
>Synopsis:       fingerd logging not IPv6 aware
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 17 10:00:01 PST 2000
>Closed-Date:    Thu Mar 2 07:32:25 PST 2000
>Last-Modified:  Thu Mar  2 07:37:52 PST 2000
>Originator:     Ben Smithurst
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

>Description:

fingerd's -l option is not IPv6 aware, which can cause problems attempting
to obtain the hostname for an IPv6 connection.

>How-To-Repeat:

change "tcp" to "tcp46" on the "finger" line in /etc/inetd.conf, add
fingerd's -l option, and connect to the finger service via an IPv6
address.

>Fix:

simple patch, may not be perfect:

diff -ur fingerd.orig/fingerd.c fingerd/fingerd.c
--- fingerd.orig/fingerd.c	Sat Aug 28 01:09:28 1999
+++ fingerd/fingerd.c	Thu Feb 17 17:07:26 2000
@@ -70,7 +70,7 @@
 	register FILE *fp;
 	register int ch;
 	register char *lp;
-	struct sockaddr_in sin;
+	struct sockaddr_storage sin;
 	int p[2], logging, secure, sval;
 #define	ENTRIES	50
 	char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog;
@@ -130,7 +130,8 @@
 		sval = sizeof(sin);
 		if (getpeername(0, (struct sockaddr *)&sin, &sval) < 0)
 			logerr("getpeername: %s", strerror(errno));
-		realhostname(rhost, sizeof rhost - 1, &sin.sin_addr);
+		realhostname_sa(rhost, sizeof rhost - 1,
+		    (struct sockaddr *)&sin, sval);
 		rhost[sizeof(rhost) - 1] = '\0';
 		syslog(LOG_NOTICE, "query from %s: `%s'", rhost, t);
 	}

>Release-Note:
>Audit-Trail:

From: Yoshinobu Inoue <shin@nd.net.fujitsu.co.jp>
To: ben@scientia.demon.co.uk
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/16789: fingerd logging not IPv6 aware
Date: Fri, 18 Feb 2000 16:16:05 +0900

 > >Synopsis:       fingerd logging not IPv6 aware
 > >Description:
 > 
 > fingerd's -l option is not IPv6 aware, which can cause problems attempting
 > to obtain the hostname for an IPv6 connection.
 
 Thanks, I applied the patch (with variable name change), and
 confirmed it locally with updated finger command.  So I
 committed it. 
 (I also made finger IPv6 update to confirm it but not yet
 committed it, because the change is small but not very
 trivial, and seems not so essential as to commit it in this
 code freeze phase. Maybe you tried it from another platform?)
 
 Please also check if it also fixed in your environment.
 
 Thanks,
 Yoshinobu Inoue
 

From: Ben Smithurst <ben@scientia.demon.co.uk>
To: Yoshinobu Inoue <shin@nd.net.fujitsu.co.jp>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/16789: fingerd logging not IPv6 aware
Date: Sun, 20 Feb 2000 13:31:55 +0000

 Yoshinobu Inoue wrote:
 
 >> fingerd's -l option is not IPv6 aware, which can cause problems attempting
 >> to obtain the hostname for an IPv6 connection.
 
 ...
 
 > Please also check if it also fixed in your environment.
 
 yes, fixed now, PR can be closed.
 
 -- 
 Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D
 
State-Changed-From-To: open->closed 
State-Changed-By: shin 
State-Changed-When: Thu Mar 2 07:32:25 PST 2000 
State-Changed-Why:  
The patch had been already committed and confirmed to be fixed. 
(This was confirmed 2 weeks ago. Sorry I forgot to close this.) 
>Unformatted:
