From mi@misha.cisco.com Fri Apr 23 14:28:12 1999
Return-Path: <mi@misha.cisco.com>
Received: from misha.cisco.com (misha.cisco.com [171.69.206.50])
	by hub.freebsd.org (Postfix) with ESMTP id 48F6E14CEC
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Apr 1999 14:28:10 -0700 (PDT)
	(envelope-from mi@misha.cisco.com)
Received: (from mi@localhost)
	by misha.cisco.com (8.9.2/8.9.1) id RAA98100;
	Fri, 23 Apr 1999 17:25:39 -0400 (EDT)
	(envelope-from mi)
Message-Id: <199904232125.RAA98100@misha.cisco.com>
Date: Fri, 23 Apr 1999 17:25:39 -0400 (EDT)
From: Mikhail Teterin <mi@misha.cisco.com>
Reply-To: mi@aldan.algebra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: fetch(1) fails to resolve names in http mode under SOCKS5
X-Send-Pr-Version: 3.2

>Number:         11296
>Category:       bin
>Synopsis:       fetch(1) fails to resolve names in http mode under SOCKS5
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 23 14:30:00 PDT 1999
>Closed-Date:    Thu Sep 28 02:21:35 PDT 2000
>Last-Modified:  Thu Sep 28 02:22:12 PDT 2000
>Originator:     Mikhail Teterin
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
Virtual Estates, Inc.
>Environment:

	FETCH_CMD = /usr/local/bin/runsocks /usr/bin/fetch -p
	on my behind-the-firewall, private-IP machine

>Description:

	The setting works perfectly for ftp MASTER_SITES. However,
	it _always_ fails to resolve a name of http server. ALWAYS.
	If given the server's IP address, it works again.

	This is not new -- I've seen it for a while on 3.1 and 2.2.[78]
	machines, but was blaming it on some DNS glitching.

>How-To-Repeat:

	# Install the socks5 port.
	nslookup www.yahoo.com
	.... works
	nslookup ftp.freebsd.org
	.... works
	/usr/local/bin/runsocks /usr/bin/fetch -p ftp://ftp.freebsd.ort/.message
	.... works
	/usr/local/bin/runsocks /usr/bin/fetch http://www.yahoo.com/
	fetch: `www.yahoo.com': cannot resolve: Host name lookup failure

>Fix:
	
	Use the ftp servers or the IP addresses.

>Release-Note:
>Audit-Trail:

From: Mikhail Teterin <mi@aldan.algebra.com>
To: freebsd-gnats-submit@freebsd.org, mi@aldan.algebra.com
Cc:  
Subject: Re: bin/11296: fetch(1) fails to resolve names in http mode under SOCKS5
Date: Tue, 06 Jul 1999 01:48:45 -0400

 This is a multi-part message in MIME format.
 --------------0E9E235F77A464A42258D8EE
 Content-Type: text/plain; charset=koi8-r
 Content-Transfer-Encoding: 7bit
 
 The gethostbyname2 used in the fetch's http.c is not implemented
 by the Socks' libsocks5_sh.so. The attached simple patch makes fetch
 resolve the names, but fetch still does not work -- this time with the
 ``No route to host''. Some other piece of code needs to be altered to
 only use calls provided for by the Socks5 wrapper library.
 
 Someone with better understanding of network programming has to take
 a look at it...
 
 -- 
                          |\__-----__/|
                     _____/ :::::  :::\_____ 
                    '__--( ::::::::..::)--__`	-mi
 If you have a      /  _- \/  :::::::\/ -_  
 serious knowledge    /   / :.   .::::\   \
 about computers --      | ::::::::::::|  	Ok, let's say you broke 
 keep it in a secret!   _|/ ::::____::\|_	the wall with your head
 "Rules of dating",   /  /:::::/:_::\::\:.\      What are you going to
 'Playboy', ? 1994   | :|  ..:(_/ \::|::|::|	do in the next cell?
                     | :|:::::. ::|: |::|.:|	      Stanislaw J. Lec
                      \ |::  :::_/::/: :|:/
                    ((___\____\____/___/___))
 --------------0E9E235F77A464A42258D8EE
 Content-Type: text/plain; charset=koi8-r;
  name="http.c.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="http.c.patch"
 
 --- http.c.dumb	Sat Jun 26 13:22:18 1999
 +++ http.c	Tue Jul  6 01:38:16 1999
 @@ -485,3 +485,3 @@
  		/* XXX - do timeouts for name resolution? */
 -		hp = gethostbyname2(https->http_hostname, AF_INET);
 +		hp = gethostbyname(https->http_hostname);
  		if (hp == 0) {
 
 --------------0E9E235F77A464A42258D8EE
 Content-Type: text/x-vcard; charset=koi8-r;
  name="mi.vcf"
 Content-Transfer-Encoding: 7bit
 Content-Description: Card for Mikhail Teterin
 Content-Disposition: attachment;
  filename="mi.vcf"
 
 begin:vcard 
 n:Teterin;Mikhail
 x-mozilla-html:FALSE
 org:Virtual Estates, Inc.
 adr:;;;;;;
 version:2.1
 email;internet:mi@aldan.algebra.com
 title:President
 x-mozilla-cpt:;0
 fn:Mikhail Teterin
 end:vcard
 
 --------------0E9E235F77A464A42258D8EE--
 
 
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Thu Jun 29 02:32:16 PDT 2000 
Responsible-Changed-Why:  
fetch(1) is mine. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11296 

From: Dag-Erling Smorgrav <des@flood.ping.uio.no>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: bin/11296
Date: 31 Aug 2000 16:44:38 +0200

 Could you please verify if this works properly in 4.1-STABLE and / or
 5.0-CURRENT?
 
 DES
 -- 
 Dag-Erling Smorgrav - des@flood.ping.uio.no
 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Thu Sep 28 02:21:35 PDT 2000 
State-Changed-Why:  
The version of fetch(1) present in 4-STABLE and 5-CURRENT do not 
have this problem. 

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