summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-03-24 00:32:11 +0000
committerdes <des@FreeBSD.org>2001-03-24 00:32:11 +0000
commitdeabc3a3798d11fd3d8f93b0effcb681e11660b4 (patch)
treed38c246b337be92b698c8e8a50d0e2cb60b20ed1 /usr.bin/fetch
parentbfaef3b3b9e81cd8473ce5a40cbd703c74aa6b87 (diff)
downloadFreeBSD-src-deabc3a3798d11fd3d8f93b0effcb681e11660b4.zip
FreeBSD-src-deabc3a3798d11fd3d8f93b0effcb681e11660b4.tar.gz
Now that libfetch uses the high port range by default, add a -U option to
make it use the low (default) port range instead.
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/fetch.113
-rw-r--r--usr.bin/fetch/fetch.c17
2 files changed, 17 insertions, 13 deletions
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index 9893f2d..8603b7f 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -37,7 +37,7 @@
.Nd retrieve a file by Uniform Resource Locator
.Sh SYNOPSIS
.Nm
-.Op Fl 146AFHMPRadlmnpqrsv
+.Op Fl 146AFMPRUadlmnpqrsv
.Op Fl B Ar bytes
.Op Fl S Ar bytes
.Op Fl T Ar seconds
@@ -101,11 +101,6 @@ The file to retrieve is named
on the remote host.
This option is deprecated and is provided for backward compatibility
only.
-.It Fl H
-When using passive FTP, allocate a high port for the data connection.
-See
-.Xr ip 4
-for details on how to specify which port range this corresponds to.
.It Fl h Ar host
The file to retrieve is located on the host
.Ar host .
@@ -171,6 +166,12 @@ Overrides the environment variables
for FTP transfers or
.Ev HTTP_TIMEOUT
for HTTP transfers if set.
+.It Fl U
+When using passive FTP, allocate the port for the data connection from
+the low (default) port range.
+See
+.Xr ip 4
+for details on how to specify which port range this corresponds to.
.It Fl v
Increase verbosity level.
.It Fl w Ar seconds
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 3325346..1251315 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -55,7 +55,6 @@ char *c_dirname; /* -c: remote directory */
int d_flag; /* -d: direct connection */
int F_flag; /* -F: restart without checking mtime */
char *f_filename; /* -f: file to fetch */
-int H_flag; /* -H: use high port */
char *h_hostname; /* -h: host to fetch from */
int l_flag; /* -l: link rather than copy file: URLs */
int m_flag; /* -[Mm]: mirror mode */
@@ -68,10 +67,11 @@ int once_flag; /* -1: stop at first successful file */
int p_flag; /* -[Pp]: use passive FTP */
int R_flag; /* -R: don't delete partially transferred files */
int r_flag; /* -r: restart previously interrupted transfer */
-u_int T_secs = 0; /* -T: transfer timeout in seconds */
-int s_flag; /* -s: show size, don't fetch */
off_t S_size; /* -S: require size to match */
+int s_flag; /* -s: show size, don't fetch */
+u_int T_secs = 0; /* -T: transfer timeout in seconds */
int t_flag; /*! -t: workaround TCP bug */
+int U_flag; /* -U: do not use high ports */
int v_level = 1; /* -v: verbosity level */
int v_tty; /* stdout is a tty */
u_int w_secs; /* -w: retry delay */
@@ -234,8 +234,8 @@ fetch(char *URL, char *path)
strcat(flags, "p");
if (d_flag)
strcat(flags, "d");
- if (H_flag)
- strcat(flags, "h");
+ if (U_flag)
+ strcat(flags, "l");
timeout = T_secs ? T_secs : ftp_timeout;
}
@@ -537,7 +537,7 @@ main(int argc, char *argv[])
int c, e, r;
while ((c = getopt(argc, argv,
- "146AaB:bc:dFf:h:lHMmnPpo:qRrS:sT:tvw:")) != EOF)
+ "146AaB:bc:dFf:Hh:lMmnPpo:qRrS:sT:tUvw:")) != EOF)
switch (c) {
case '1':
once_flag = 1;
@@ -575,7 +575,7 @@ main(int argc, char *argv[])
f_filename = optarg;
break;
case 'H':
- H_flag = 1;
+ warnx("The -H option is now implicit, use -U to disable\n");
break;
case 'h':
h_hostname = optarg;
@@ -626,6 +626,9 @@ main(int argc, char *argv[])
t_flag = 1;
warnx("warning: the -t option is deprecated");
break;
+ case 'U':
+ U_flag = 1;
+ break;
case 'v':
v_level++;
break;
OpenPOWER on IntegriCloud