Warn about collapsing multiple slashes into 1 in ftp URL's.

Look at the FTP_PASSIVE_MODE environment variable like the man page says.

PR:		bin/9464
Submitted by:	John A. Shue <John.Shue@symmetron.com>

Add references to RFC's 1790, 959, 850.

PR:		doc/6564
This commit is contained in:
Bill Fenner 1999-02-03 20:43:29 +00:00
parent 93eb50393d
commit 054672c795
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43569
2 changed files with 34 additions and 4 deletions

View file

@ -1,4 +1,4 @@
.\" $Id: fetch.1,v 1.26 1998/12/08 13:00:48 cracauer Exp $
.\" $Id: fetch.1,v 1.27 1999/01/15 16:56:22 wollman Exp $
.Dd January 15, 1999
.Dt FETCH 1
.Os FreeBSD 3.1
@ -151,6 +151,12 @@ URL's, a username and password may be specified, using the syntax
If the path is to be absolute, as opposed to relative to the user's
home directory, it must start with %2F, as in
.Li ftp://root:mypass@localhost/%2Fetc/passwd .
.Nm Fetch
condenses multiple slashes in an
.Tn ftp
URL into a single slash; literal multiple slashes translate to an
.Tn ftp
protocol error.
.Sh PROXY SERVERS
Many sites use application gateways (``proxy servers'') in their
firewalls in order to allow communication across the firewall using a
@ -326,6 +332,27 @@ connection.
.%O RFC 2068
.%D January 1997
.Re
.Rs
.%A T. Berners-Lee
.%A L. Masinter
.%A M. McCahill
.%T "Uniform Resource Locators (URL)"
.%O RFC 1738
.%D December 1994
.Re
.Rs
.%A J. Postel
.%A J.K. Reynolds
.%T "File Transfer Protocol"
.%O RFC 959 / STD 9
.%D October 1985
.Re
.Rs
.%A M.R. Horton
.%T "Standard for interchange of USENET messages."
.%O RFC 850
.%D June 1983
.Re
.Sh HISTORY
The
.Nm fetch

View file

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ftp.c,v 1.10 1998/09/20 00:01:26 jkh Exp $
* $Id: ftp.c,v 1.11 1998/12/08 13:00:49 cracauer Exp $
*/
#include <sys/types.h>
@ -180,9 +180,10 @@ ftp_parse(struct fetch_state *fs, const char *uri)
* we just pretend that multiple slashes are a
* single slash.
*/
if (*r == '\0')
if (*r == '\0') {
warnx("skipping double slash in FTP URL; see man page or RFC1738.");
ftps->ftp_remote_ndirs--;
else
} else
*dp++ = percent_decode(r);
r = s;
}
@ -366,6 +367,8 @@ ftp_retrieve(struct fetch_state *fs)
}
} else
ftpBinary(ftp);
if (getenv("FTP_PASSIVE_MODE"))
fs->fs_passive_mode = 1;
ftpPassive(ftp, fs->fs_passive_mode);
for (i = 0, dp = ftps->ftp_remote_dirs; i < ftps->ftp_remote_ndirs; i++, dp++) {
if ((status = ftpChdir(ftp, *dp)) != 0) {