From nobody@FreeBSD.ORG  Fri Nov 24 04:55:36 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 82E9A37B4C5; Fri, 24 Nov 2000 04:55:36 -0800 (PST)
Message-Id: <20001124125536.82E9A37B4C5@hub.freebsd.org>
Date: Fri, 24 Nov 2000 04:55:36 -0800 (PST)
From: tarjei.jensen@kvaerner.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: fetch in FreeBSD 4.2 does not work with FTP proxy
X-Send-Pr-Version: www-1.0

>Number:         23067
>Category:       i386
>Synopsis:       fetch in FreeBSD 4.2 does not work with FTP proxy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 24 05:00:00 PST 2000
>Closed-Date:    Fri Nov 24 08:00:12 PST 2000
>Last-Modified:  Sun Nov 26 09:20:01 PST 2000
>Originator:     Tarjei T. Jensen
>Release:        4.2
>Organization:
Kvrner Oil & Gas ASA
>Environment:
FreeBSD testmaskin.kogfd.kvaerner.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386

>Description:
When I used 4.1 I could set FTP_PASSIVE_MODE=NO and FTP_PROXY=our_proxy and I could get the make program in ports to fetch files for me.

With 4.2 and the same setup, the fetch stuff seems to try to use the ftp proxy as a http proxy. When I use fetch -v it says that it connects to port 80 on the ftp proxy. It is supposed to use port 21 and log in as user@remote_host.

I only set FTP_PASSIVE_MODE=OFF and FTP_PROXY=our_proxy. I set no other variable which fetch uses.
>How-To-Repeat:
It is there all the time.
>Fix:
Write my own fetch program!

>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: tarjei.jensen@kvaerner.com
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP proxy
Date: Fri, 24 Nov 2000 15:05:59 +0200

 On Fri, Nov 24, 2000 at 04:55:36AM -0800, tarjei.jensen@kvaerner.com wrote:
 > 
 > >Number:         23067
 > >Category:       i386
 > >Synopsis:       fetch in FreeBSD 4.2 does not work with FTP proxy
 [snip]
 > >Environment:
 > FreeBSD testmaskin.kogfd.kvaerner.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386
 > 
 > >Description:
 > When I used 4.1 I could set FTP_PASSIVE_MODE=NO and FTP_PROXY=our_proxy and I could get the make program in ports to fetch files for me.
 > 
 > With 4.2 and the same setup, the fetch stuff seems to try to use the ftp proxy as a http proxy. When I use fetch -v it says that it connects to port 80 on the ftp proxy. It is supposed to use port 21 and log in as user@remote_host.
 > 
 > I only set FTP_PASSIVE_MODE=OFF and FTP_PROXY=our_proxy. I set no other variable which fetch uses.
 > >How-To-Repeat:
 > It is there all the time.
 > >Fix:
 > Write my own fetch program!
 
 Which port exactly are you trying to fetch?  Can you paste the full output
 of 'make fetch' in that port's directory?
 
 G'luck,
 Peter
 
 -- 
 This sentence no verb.
 

From: Peter Pentchev <roam@orbitel.bg>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP proxy
Date: Fri, 24 Nov 2000 17:59:21 +0200

 I should think this PR may safely be closed now, what with the following
 exchange with the originator that took place in private mail.
 
 G'luck,
 Peter
 
 -- 
 No language can express every thought unambiguously, least of all this one.
 
 On Fri, Nov 24, 2000 at 03:51:42PM -0000, Tarjei.Jensen@kvaerner.com wrote:
 > That did it!
 > 
 > FTP_PROXY=ftp://our_proxy worked.
 > 
 > Using FTP_PROXY=our_proxy:21 did not work.
 > 
 > Thanks!
 > 
 > I suppose you will have to fix the documentation to reflect the changes in
 > the fetch library.
 > 
 > That was rapid solving of a problem.
 > 
 > Greetings,
 > 
 > > -----Original Message-----
 > > From: Peter Pentchev [mailto:roam@orbitel.bg]
 > > Sent: 24. november 2000 16:00
 > > To: Jensen, Tarjei KOGAS
 > > Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP
 > > proxy
 > > 
 > > 
 > > On Fri, Nov 24, 2000 at 04:49:15PM +0200, Peter Pentchev wrote:
 > > > Alright, can you try the same with FTP_PROXY=your_proxy:21?
 > > > It seems that fetch defaults to using port 80 if no port is 
 > > specified.
 > > 
 > > To be a bit more precise - since revision 1.51 of 
 > > src/lib/libfetch/ftp.c,
 > > which was MFC'd just before 4.2-RELEASE, libfetch now takes HTTP to be
 > > the default scheme if no scheme is specified.  You *can* specify a FTP
 > > scheme in your FTP_PROXY variable by using the ftp:// prefix; 
 > > now I'm not
 > > so sure if using hostname:21 would work and not be treated as an HTTP
 > > connection to port 21.
 > > 
 > > So.. another suggestion - try FTP_PROXY=ftp://your_proxy and see if
 > > that helps.
 
State-Changed-From-To: open->closed 
State-Changed-By: roam 
State-Changed-When: Fri Nov 24 08:00:12 PST 2000 
State-Changed-Why:  
Originator was satisfied with specifying FTP_PROXY=ftp://hostname. 

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

From: Dag-Erling Smorgrav <des@ofug.org>
To: tarjei.jensen@kvaerner.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP proxy
Date: 26 Nov 2000 17:01:41 +0100

 tarjei.jensen@kvaerner.com writes:
 > With 4.2 and the same setup, the fetch stuff seems to try to use the
 > ftp proxy as a http proxy. When I use fetch -v it says that it
 > connects to port 80 on the ftp proxy. It is supposed to use port 21
 > and log in as user@remote_host.
 
 RTFM.
 
 DES
 -- 
 Dag-Erling Smorgrav - des@ofug.org
 

From: Peter Pentchev <roam@orbitel.bg>
To: Dag-Erling Smorgrav <des@ofug.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP proxy
Date: Sun, 26 Nov 2000 19:18:13 +0200

 On Sun, Nov 26, 2000 at 08:10:03AM -0800, Dag-Erling Smorgrav wrote:
 > The following reply was made to PR i386/23067; it has been noted by GNATS.
 > 
 > From: Dag-Erling Smorgrav <des@ofug.org>
 > To: tarjei.jensen@kvaerner.com
 > Cc: freebsd-gnats-submit@FreeBSD.ORG
 > Subject: Re: i386/23067: fetch in FreeBSD 4.2 does not work with FTP proxy
 > Date: 26 Nov 2000 17:01:41 +0100
 > 
 >  tarjei.jensen@kvaerner.com writes:
 >  > With 4.2 and the same setup, the fetch stuff seems to try to use the
 >  > ftp proxy as a http proxy. When I use fetch -v it says that it
 >  > connects to port 80 on the ftp proxy. It is supposed to use port 21
 >  > and log in as user@remote_host.
 >  
 >  RTFM.
 
 There was no call for that now, was there - this PR is already closed
 to the originator's satisfaction - explicitly specifying the URL schema
 as ftp:// does the trick.  However, your remark begs the question - *which*
 manual?  Neither the fetch(1), nor the fetch(3) manpage on -stable suggests
 that HTTP is used as the default schema - I was able to find out this was
 a schema problem only by grepping for FTP_PROXY in src/lib/libfetch and
 scanning the annotated CVS file around the found lines :(
 
 And just to show that I'm writing this in good faith, not to slight or
 anything, attached is a proposed patch to fetch.1 to document this HTTP
 default.  The patch is against -stable, but it also applies cleanly to
 -current with 1-line fuzz.  And btw - since I am not at all comfortable
 with mdoc - is .Em the right tag to use for the ftp:// prefix on the last
 line?  I tried using .Pf, but it would not allow me to glue a dot
 at the end :(
 
 On second thoughts.. wouldn't this be better documented in fetch(3)..
 But still, I'd think it deserves mentioning in fetch(1).
 
 G'luck,
 Peter
 
 -- 
 If the meanings of 'true' and 'false' were switched, then this sentence wouldn't be false.
 
 Index: fetch.1
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/fetch/fetch.1,v
 retrieving revision 1.33.2.4
 diff -u -r1.33.2.4 fetch.1
 --- fetch.1	2000/07/21 11:20:05	1.33.2.4
 +++ fetch.1	2000/11/26 17:12:38
 @@ -238,3 +238,13 @@
  and
  .Fl f
  options and specify URLs on the command line.
 +.Pp
 +All URL's processed by
 +.Nm
 +(including those specified on the command line, or those given in the
 +.Ev FTP_PROXY
 +and
 +.Ev HTTP_PROXY
 +environment variables) are considered by default to be HTTP URL's,
 +unless explicitly given an FTP schema by prefixing them with
 +.Em ftp:// .
 
>Unformatted:
