bin/94181: portsnap should remove the trailing dot from the servername

Hiroki Sato hrs at FreeBSD.org
Tue Mar 7 10:20:11 PST 2006


>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 at 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 at .

>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:


More information about the freebsd-bugs mailing list