Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2006 03:13:04 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        cperciva@FreeBSD.org
Subject:   bin/94181: portsnap should remove the trailing dot from the servername
Message-ID:  <200603071813.k27ID4Q1045305@alph.allbsd.org>
Resent-Message-ID: <200603071820.k27IK5mF049309@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         94181
>Category:       bin
>Synopsis:       portsnap should remove the trailing dot from the servername
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 07 18:20:05 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603071813.k27ID4Q1045305>