summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1999-02-03 20:43:29 +0000
committerfenner <fenner@FreeBSD.org>1999-02-03 20:43:29 +0000
commitadb8ba8144ce2b91bea380dfab072db7d773206b (patch)
tree17e9ea8360bb7bd5d29a6860b2e0b27313efbc19 /usr.bin
parentaf6685ec337a58b54afcd24d9b93bd69225e9d73 (diff)
downloadFreeBSD-src-adb8ba8144ce2b91bea380dfab072db7d773206b.zip
FreeBSD-src-adb8ba8144ce2b91bea380dfab072db7d773206b.tar.gz
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
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fetch/fetch.129
-rw-r--r--usr.bin/fetch/ftp.c9
2 files changed, 34 insertions, 4 deletions
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index f3be659..bab5988 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -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
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c
index 45c8ecf..78b57ff 100644
--- a/usr.bin/fetch/ftp.c
+++ b/usr.bin/fetch/ftp.c
@@ -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) {
OpenPOWER on IntegriCloud