From dan@obluda.cz  Sun Oct 30 15:38:53 2005
Return-Path: <dan@obluda.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EB9E616A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Oct 2005 15:38:53 +0000 (GMT)
	(envelope-from dan@obluda.cz)
Received: from kulesh.obluda.cz (ip-85-160-0-18.eurotel.cz [85.160.0.18])
	by mx1.FreeBSD.org (Postfix) with ESMTP id ACAB043D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Oct 2005 15:38:50 +0000 (GMT)
	(envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.13.4/8.13.4) id j9UFckMn001052
	for FreeBSD-gnats-submit@freebsd.org; Sun, 30 Oct 2005 16:38:46 +0100 (CET)
	(envelope-from dan@obluda.cz)
Message-Id: <200510301538.j9UFckMn001052@kulesh.obluda.cz>
Date: Sun, 30 Oct 2005 16:38:46 +0100 (CET)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ PATCH ] Incorrect processing of multiple PTR records 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         88241
>Category:       kern
>Synopsis:       [libc] [patch] Incorrect processing of multiple PTR records
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 30 15:40:19 GMT 2005
>Closed-Date:    Fri Nov 18 11:13:41 GMT 2005
>Last-Modified:  Fri Nov 18 11:13:41 GMT 2005
>Originator:     Dan Lukes
>Release:        FreeBSD 6.0-RC1 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 6.0-RC1 #6: Sun Oct 16 21:03:18 CEST 2005 i386
lib/libc/net/name6.c,v 1.54 2005/05/27 20:44:57 ume
lib/libc/net/res_config.h,v 1.8 2002/03/22 23:41:54 obrien

>Description:
	res_config.h define MULTI_PTRS_ARE_ALIASES
	It causes the gethostbyname() fold multiple PTR records into h_aliases
member of struct hostent

	The KAME's getipnodebyaddr() code honor the MULTI_PTRS_ARE_ALIASES
define also, but res_config.h isn't included into linc/net/names6.c nor
other include define the flag. So getipnodebyaddr() ignore the multiple PTRs.

>How-To-Repeat:
	Create code using gethostbyname and getipnodebyaddr, call it for an
addres with multiple PTR records then compare results.
>Fix:

	There are several ways to define the flag. I recommend the
following:

--- patch begins here ---
--- lib/libc/net/name6.c.ORIG	Thu Oct 27 01:18:37 2005
+++ lib/libc/net/name6.c	Thu Oct 27 01:20:27 2005
@@ -119,6 +119,7 @@
 #include <stdarg.h>
 #include <nsswitch.h>
 #include <unistd.h>
+#include "res_config.h"
 #include "un-namespace.h"
 #include "netdb_private.h"
 
--- patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ume 
Responsible-Changed-By: ume 
Responsible-Changed-When: Tue Nov 15 03:40:52 GMT 2005 
Responsible-Changed-Why:  
Thank you for your report.  I've just committed it into HEAD. 
I'll MFC it after some period. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88241 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Tue Nov 15 07:27:03 GMT 2005 
State-Changed-Why:  
Note that this was committed to -HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88241 
State-Changed-From-To: patched->closed 
State-Changed-By: ume 
State-Changed-When: Fri Nov 18 11:12:38 GMT 2005 
State-Changed-Why:  
I've MFC'ed it into RELENG_6, RELENG_5 and RELENG_4. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88241 
>Unformatted:
