From hrs@allbsd.org  Tue Mar  7 18:15:43 2006
Return-Path: <hrs@allbsd.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0908216A423;
	Tue,  7 Mar 2006 18:15:33 +0000 (GMT)
	(envelope-from hrs@allbsd.org)
Received: from mail.allbsd.org (vlsi00.si.noda.tus.ac.jp [133.31.130.32])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8AC9843D69;
	Tue,  7 Mar 2006 18:15:28 +0000 (GMT)
	(envelope-from hrs@allbsd.org)
Received: from delta.allbsd.org (p5180-ipbf304funabasi.chiba.ocn.ne.jp [125.170.156.180])
	(authenticated bits=128)
	by mail.allbsd.org (8.13.4/8.13.4) with ESMTP id k27IFB0R029955;
	Wed, 8 Mar 2006 03:15:27 +0900 (JST)
	(envelope-from hrs@allbsd.org)
Received: from alph.allbsd.org (alph.allbsd.org [192.168.0.10])
	by delta.allbsd.org (8.13.4/8.13.4) with ESMTP id k27ID5i4006979;
	Wed, 8 Mar 2006 03:13:07 +0900 (JST)
	(envelope-from hrs@alph.d.allbsd.org)
Received: from alph.allbsd.org (localhost [127.0.0.1])
	by alph.allbsd.org (8.13.4/8.13.4) with ESMTP id k27ID43F045306;
	Wed, 8 Mar 2006 03:13:05 +0900 (JST)
	(envelope-from hrs@alph.d.allbsd.org)
Received: (from hrs@localhost)
	by alph.allbsd.org (8.13.4/8.13.4/Submit) id k27ID4Q1045305;
	Wed, 8 Mar 2006 03:13:04 +0900 (JST)
	(envelope-from hrs)
Message-Id: <200603071813.k27ID4Q1045305@alph.allbsd.org>
Date: Wed, 8 Mar 2006 03:13:04 +0900 (JST)
From: Hiroki Sato <hrs@freebsd.org>
Reply-To: Hiroki Sato <hrs@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: cperciva@freebsd.org
Subject: portsnap should remove the trailing dot from the servername
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         94181
>Category:       bin
>Synopsis:       portsnap(8) should remove the trailing dot from the servername
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 07 18:20:05 GMT 2006
>Closed-Date:    Mon Nov 05 07:58:26 UTC 2012
>Last-Modified:  Mon Nov 05 07:58:26 UTC 2012
>Originator:     Hiroki Sato
>Release:        FreeBSD 6.0-RELEASE i386
>Organization:
Tokyo University of Science
>Environment:
FreeBSD spike2.allbsd.org 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Mon Jan 23 02:16:00 JST 2006     hrs@spike2.allbsd.org:/usr/obj/usr/src/sys/SPIKE2  i386

>Description:
	portsnap uses host(1) for SRV query, but the response can include
	trailing dot in the domain names, which prevents some HTTP proxy
	from working.  This problem is reported by ume@.

>How-To-Repeat:
	N/A

>Fix:

Index: portsnap.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/portsnap/portsnap/portsnap.sh,v
retrieving revision 1.14
diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.14 portsnap.sh
--- portsnap.sh	22 Jan 2006 23:48:07 -0000	1.14
+++ portsnap.sh	7 Mar 2006 17:55:14 -0000
@@ -328,7 +328,7 @@
 # Issue the SRV query and pull out the Priority, Weight, and Target fields.
 	host -t srv "_http._tcp.${SERVERNAME}" |
 	    grep -E "^_http._tcp.${SERVERNAME} has SRV record" |
-	    cut -f 5,6,8 -d ' ' > serverlist
+	    cut -f 5,6,8 -d ' ' | sed -e 's/\.$//' > serverlist
 
 # If no records, give up -- we'll just use the server name we were given.
 	if [ `wc -l < serverlist` -eq 0 ]; then
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cperciva 
Responsible-Changed-By: hrs 
Responsible-Changed-When: Tue Mar 7 18:26:54 UTC 2006 
Responsible-Changed-Why:  
over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94181 
State-Changed-From-To: open->patched 
State-Changed-By: hrs 
State-Changed-When: Tue Mar 7 19:24:32 UTC 2006 
State-Changed-Why:  
Committed to -CURRENT and waiting MFC now. 


Responsible-Changed-From-To: cperciva->ume 
Responsible-Changed-By: hrs 
Responsible-Changed-When: Tue Mar 7 19:24:32 UTC 2006 
Responsible-Changed-Why:  
Over to the originator who also have handled this patch actually. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94181 
State-Changed-From-To: patched->closed 
State-Changed-By: ume 
State-Changed-When: Mon Nov 5 07:57:38 UTC 2012 
State-Changed-Why:  
It was already fixed. 

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