From mi@xxx.video-collage.com  Fri May  8 18:50:08 1998
Received: from ziplink.net (relay-0.ziplink.net [206.15.168.49])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA03370
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 8 May 1998 18:50:05 -0700 (PDT)
          (envelope-from mi@xxx.video-collage.com)
Received: from xxx.video-collage.com (xxx.video-collage.com [199.232.254.68])
	by ziplink.net (8.8.7/8.8.7) with ESMTP id VAA17662
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 8 May 1998 21:49:57 -0400 (EDT)
Received: (from mi@localhost)
	by xxx.video-collage.com (8.8.8/8.8.7) id VAA03423;
	Fri, 8 May 1998 21:49:51 -0400 (EDT)
	(envelope-from mi)
Message-Id: <199805090149.VAA03423@xxx.video-collage.com>
Date: Fri, 8 May 1998 21:49:51 -0400 (EDT)
From: Mikhail Teterin <mi@video-collage.com>
Reply-To: mi@aldan.algebra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: fetch does breaks absolute pathnames
X-Send-Pr-Version: 3.2

>Number:         6558
>Category:       bin
>Synopsis:       fetch -c /tmp -f somefile does not work
>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 May  8 18:50:01 PDT 1998
>Closed-Date:    Sat May 9 01:50:12 PDT 1998
>Last-Modified:  Sat May  9 01:50:30 PDT 1998
>Originator:     Mikhail Teterin
>Release:        FreeBSD 2.2.6-BETA i386
>Organization:
Video Collage, Inc.
>Environment:

	2.2.6-BETA FreeBSD 2.2.6-BETA #0: Tue Mar 24 13:28:00 EST 1998

>Description:

	fetch -c /somedir -f somefile -h server
is _quetly_ translated into
	fetch -c somedir -f somefile -h server
which, of course, breaks if the user's home directory on the server
is not /

>How-To-Repeat:

	setenv FTP_LOGIN your_login
	setenv FTP_PASSWORD yourPassword
	fetch -v -v -v -v -c /tmp -f fixit.flp.bz -h www
	...
	User your_login logged in.
	Sending: TYPE I
	Type set to I.
	Sending: CWD tmp
	tmp: No such file or directory.
	fetch: www: tmp: File unavailable (e.g., file not found, no access)

Same problem occurs when using the URL mode as in
	fetch -v -v -v -v -o - ftp://www//tmp/fixit.flp.bz
Same result as above.

>Fix:
	
	Use some other tool. Providing extra slashes does not help
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Sat May 9 00:24:06 PDT 1998 
State-Changed-Why:  
Fetch takes a URL.  This is how ftp: URL's work.  Use 
ftp://some.host/%2Cdirectory/ if you want a real slash. 
(Technically, ftp://some.host//directory/ means to perform 
a sequence of commands which violates the FTP protocol, 
which is why fetch silently drops the extra slash). 
I addressed this issue in the man page but forgot to 
commit it; mea culpa. 
State-Changed-From-To: closed->open 
State-Changed-By: fenner 
State-Changed-When: Sat May 9 00:41:21 PDT 1998 
State-Changed-Why:  
The bug is about "-c", not the URL syntax.  I didn't read it 
carefully enough.  There's an XXX comment in main.c describing 
the fix to this bug; the solution to this PR is to implement the 
fix described in the comment.  Sorry for jumping the gun on 
closing the PR. 

From: Bill Fenner <fenner@parc.xerox.com>
To: Bill Fenner <fenner@freebsd.org>
Cc: mi@aldan.algebra.com, freebsd-gnats-submit@freebsd.org
Subject: Re: bin/6558 
Date: Sat, 9 May 1998 00:44:24 PDT

 In message <199805090731.AAA15743@freefall.freebsd.org> you write:
 >ftp://some.host/%2Cdirectory/ if you want a real slash.
 
 Of course, I meant %2F.  And I skipped over the part where the
 original complaint was about the "-c" flag.  Checking the code,
 this problem was thought of but not addressed:
 
             /*
              * XXX - we should %-map a leading `/' into `%2f', but for
              * anonymous FTP it is unlikely to matter.  Still, it would
              * be better to follow the spec.
              */
 
 So, for now, use the ftp://some.host/%2Fdirectory/ URL form, and
 someone should fix fetch to do what the comment says to do.
 
   Bill
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Sat May 9 01:50:12 PDT 1998 
State-Changed-Why:  
Fixed in -current and -stable. 
>Unformatted:
