The NetBSD Project

CVS log for src/usr.bin/ftp/ftp.c

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / ftp

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.176 / (download) - annotate - [select for diffs], Sun Feb 18 22:29:56 2024 UTC (5 weeks, 3 days ago) by christos
Branch: MAIN
CVS Tags: HEAD
Changes since 1.175: +3 -2 lines
Diff to previous 1.175 (colored) to selected 1.126.2.5 (colored)

Add -b <buflen> to specify the buffer size.

Revision 1.174.2.1 / (download) - annotate - [select for diffs], Tue May 16 16:26:03 2023 UTC (10 months, 1 week ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.174: +6 -4 lines
Diff to previous 1.174 (colored) next main 1.175 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #171):

	usr.bin/ftp/ssl.c: revision 1.15
	usr.bin/ftp/util.c: revision 1.167
	usr.bin/ftp/ftp.c: revision 1.175
	usr.bin/ftp/version.h: revision 1.97

add timeout for ssl connect

Implement a timeout for SSL connection setup, using -q QUITTIME,
defaulting to 60 seconds.

SSL_connect(3) (unlike connect(2)) doesn't timeout by default.
Adapt ssl error messages destination: if unexpected error
from local API, use warn()/warnx() to stderr;
if expected error from a network operation (e.g., timeouts),
use fprintf to ttyout (which might be stdout).

Consistently use ftp_poll() instead of select();
ssl.c (using select()) was added 7 years after the
previous uses of select() were converted to poll().

Check EAGAIN as well as existing EINTR error from ftp_poll(),
for portability.

Revision 1.175 / (download) - annotate - [select for diffs], Fri May 5 15:46:06 2023 UTC (10 months, 3 weeks ago) by lukem
Branch: MAIN
Changes since 1.174: +6 -4 lines
Diff to previous 1.174 (colored) to selected 1.126.2.5 (colored)

add timeout for ssl connect

Implement a timeout for SSL connection setup, using -q QUITTIME,
defaulting to 60 seconds.
SSL_connect(3) (unlike connect(2)) doesn't timeout by default.

Adapt ssl error messages destination: if unexpected error
from local API, use warn()/warnx() to stderr;
if expected error from a network operation (e.g., timeouts),
use fprintf to ttyout (which might be stdout).

Consistently use ftp_poll() instead of select();
ssl.c (using select()) was added 7 years after the
previous uses of select() were converted to poll().

Check EAGAIN as well as existing EINTR error from ftp_poll(),
for portability.

Revision 1.167.6.3 / (download) - annotate - [select for diffs], Mon Sep 12 17:08:13 2022 UTC (18 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.167.6.2: +83 -44 lines
Diff to previous 1.167.6.2 (colored) to branchpoint 1.167 (colored) next main 1.168 (colored) to selected 1.126.2.5 (colored)

Catch up to current, requested by christos in ticket #1763:

        usr.bin/ftp/Makefile                            up to 1.39
        usr.bin/ftp/cmds.c                              up to 1.141
        usr.bin/ftp/complete.c                          up to 1.47
        usr.bin/ftp/domacro.c                           up to 1.23
        usr.bin/ftp/extern.h                            up to 1.82
        usr.bin/ftp/fetch.c                             up to 1.235
        usr.bin/ftp/ftp.1                               up to 1.147
        usr.bin/ftp/ftp.c                               up to 1.174
        usr.bin/ftp/ftp_var.h                           up to 1.86
        usr.bin/ftp/main.c                              up to 1.128
        usr.bin/ftp/progressbar.c                       up to 1.24
        usr.bin/ftp/progressbar.h                       up to 1.9
        usr.bin/ftp/ssl.c                               up to 1.12
        usr.bin/ftp/ssl.h                               up to 1.5
        usr.bin/ftp/util.c                              up to 1.164
        usr.bin/ftp/version.h                           up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.

Revision 1.168.2.7 / (download) - annotate - [select for diffs], Mon Sep 12 17:06:56 2022 UTC (18 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.168.2.6: +2 -2 lines
Diff to previous 1.168.2.6 (colored) to branchpoint 1.168 (colored) next main 1.169 (colored) to selected 1.126.2.5 (colored)

Catch up to current, requested by christos in ticket #1523

	usr.bin/ftp/Makefile				up to 1.39
	usr.bin/ftp/fetch.c				up to 1.235
	usr.bin/ftp/ftp.1				up to 1.147
	usr.bin/ftp/ftp_var.h				up to 1.86
	usr.bin/ftp/main.c				up to 1.128
	usr.bin/ftp/ssl.c				up to 1.12
	usr.bin/ftp/util.c				up to 1.164
	usr.bin/ftp/version.h				up to 1.94

PR 57003: Support relative redirects.

Revision 1.167.6.2 / (download) - annotate - [select for diffs], Mon Sep 12 15:05:21 2022 UTC (18 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.167.6.1: +44 -83 lines
Diff to previous 1.167.6.1 (colored) to branchpoint 1.167 (colored) to selected 1.126.2.5 (colored)

Backout ticket #1763 for now - trust anchors are not solved.

Revision 1.167.6.1 / (download) - annotate - [select for diffs], Mon Sep 12 14:46:51 2022 UTC (18 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.167: +83 -44 lines
Diff to previous 1.167 (colored) to selected 1.126.2.5 (colored)

Catch up to current, requested by christos in ticket #1763:

	usr.bin/ftp/Makefile                            up to 1.39
	usr.bin/ftp/cmds.c                              up to 1.141
	usr.bin/ftp/complete.c                          up to 1.47
	usr.bin/ftp/domacro.c                           up to 1.23
	usr.bin/ftp/extern.h                            up to 1.82
	usr.bin/ftp/fetch.c                             up to 1.235
	usr.bin/ftp/ftp.1                               up to 1.147
	usr.bin/ftp/ftp.c                               up to 1.174
	usr.bin/ftp/ftp_var.h                           up to 1.86
	usr.bin/ftp/main.c                              up to 1.128
	usr.bin/ftp/progressbar.c                       up to 1.24
	usr.bin/ftp/progressbar.h                       up to 1.9
	usr.bin/ftp/ssl.c                               up to 1.11
	usr.bin/ftp/ssl.h                               up to 1.5
	usr.bin/ftp/util.c                              up to 1.164
	usr.bin/ftp/version.h                           up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.

Revision 1.168.2.6 / (download) - annotate - [select for diffs], Sun Oct 24 10:18:02 2021 UTC (2 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.168.2.5: +4 -17 lines
Diff to previous 1.168.2.5 (colored) to branchpoint 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1367):

	usr.bin/ftp/ftp.c: revision 1.174

ftp: remove unnecessary variable assignments

Remove assignment to error in initconn(); it's not tested anywhere after the
initial use, so no need to set it before goto bad.
(Looks like copypasta from the initial addition of the code in rev 1.48.)

Revision 1.168.2.5 / (download) - annotate - [select for diffs], Sun Oct 24 10:16:05 2021 UTC (2 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.168.2.4: +22 -2 lines
Diff to previous 1.168.2.4 (colored) to branchpoint 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1366):

	usr.bin/ftp/ftp.c: revision 1.173

ftp: validate address from PASV and LPSV response

Fail if the server's response to PASV or LPSV contains an IP address
that doesn't match that of the control connection.
(EPSV already only uses the port portion of the server's response,
per RFC 2428).

Previously a hostile server could cause ftp to open a data connection elsewhere.
Many other ftp implementations have had a similar change for many years,
including those in popular browsers (before they deprecated FTP ...)

Thanks to Simon Josefsson notifying me about
  https://lists.gnu.org/archive/html/bug-inetutils/2021-06/msg00002.html

Revision 1.174 / (download) - annotate - [select for diffs], Thu Aug 26 06:23:24 2021 UTC (2 years, 7 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.173: +4 -17 lines
Diff to previous 1.173 (colored) to selected 1.126.2.5 (colored)

ftp: remove unnecessary variable assignments

Remove assignment to error in initconn(); it's not tested anywhere after the
initial use, so no need to set it before goto bad.

(Looks like copypasta from the initial addition of the code in rev 1.48.)

Revision 1.173 / (download) - annotate - [select for diffs], Thu Aug 26 06:16:29 2021 UTC (2 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.172: +22 -2 lines
Diff to previous 1.172 (colored) to selected 1.126.2.5 (colored)

ftp: validate address from PASV and LPSV response

Fail if the server's response to PASV or LPSV contains an IP address
that doesn't match that of the control connection.
(EPSV already only uses the port portion of the server's response,
per RFC 2428).

Previously a hostile server could cause ftp to open a data connection elsewhere.

Many other ftp implementations have had a similar change for many years,
including those in popular browsers (before they deprecated FTP ...)

Thanks to Simon Josefsson notifying me about
  https://lists.gnu.org/archive/html/bug-inetutils/2021-06/msg00002.html

Revision 1.168.2.4 / (download) - annotate - [select for diffs], Mon Jun 14 11:45:48 2021 UTC (2 years, 9 months ago) by martin
Branch: netbsd-9
Changes since 1.168.2.3: +7 -2 lines
Diff to previous 1.168.2.3 (colored) to branchpoint 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1293):

	usr.bin/ftp/ftp.c: revision 1.172

set SO_KEEPALIVE on control connection

Attempt to prevent timeouts of the control connection by setting SO_KEEPALIVE.
This matches the equivalent behaviour in ftpd.

Note: This is a much simpler change than adding a background polling event
to invoke "STAT" (or "NOOP") on the control connection during a transfer.
(It's unclear from RFC 959 whether "NOOP" is even permitted during a transfer).

PR bin/56129

Revision 1.168.2.3 / (download) - annotate - [select for diffs], Mon Jun 14 11:28:28 2021 UTC (2 years, 9 months ago) by martin
Branch: netbsd-9
Changes since 1.168.2.2: +4 -4 lines
Diff to previous 1.168.2.2 (colored) to branchpoint 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1291):

	usr.bin/ftp/ftp.c: revision 1.169
	usr.bin/ftp/util.c: revision 1.161

ftp: exit if lostpeer invoked by a signal

lostpeer() calls too many async-unsafe functions (both directly
and indirectly) to close and cleanup the remote connections,
so just exit after the cleanup if invoked by a signal.

Reported in private mail by Qi Hou.

May also resolve a crash reported by Thomas Klausner.

Revision 1.168.2.2 / (download) - annotate - [select for diffs], Mon Jun 14 11:22:16 2021 UTC (2 years, 9 months ago) by martin
Branch: netbsd-9
Changes since 1.168.2.1: +39 -22 lines
Diff to previous 1.168.2.1 (colored) to branchpoint 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1290):

	usr.bin/ftp/version.h: revision 1.90
	usr.bin/ftp/ftp.c: revision 1.170

ftp.c: improve signal handler restoration

Only invoke the old signal handler if it's a real signal handler
and not SIG_IGN, SIG_DFL, SIG_HOLD, or SIG_ERR, using new static
function issighandler().

Avoids an intermittent race condition with a null pointer
dereference via (*SIG_DFL)().

Bug class reported by Joyu Liao from Juniper Networks.

Use SIG_ERR instead of NULL as the indicator that a signal handler
hasn't been changed, so that SIG_DFL (equivalent to NULL)
will be restored.

Revision 1.171.4.1 / (download) - annotate - [select for diffs], Sun Jun 6 20:30:54 2021 UTC (2 years, 9 months ago) by cjep
Branch: cjep_sun2x
Changes since 1.171: +7 -2 lines
Diff to previous 1.171 (colored) next main 1.172 (colored) to selected 1.126.2.5 (colored)

sync with head

Revision 1.172 / (download) - annotate - [select for diffs], Thu Jun 3 10:11:00 2021 UTC (2 years, 9 months ago) by lukem
Branch: MAIN
CVS Tags: cjep_sun2x-base1
Changes since 1.171: +7 -2 lines
Diff to previous 1.171 (colored) to selected 1.126.2.5 (colored)

set SO_KEEPALIVE on control connection

Attempt to prevent timeouts of the control connection by setting SO_KEEPALIVE.
This matches the equivalent behaviour in ftpd.

Note: This is a much simpler change than adding a background polling event
to invoke "STAT" (or "NOOP") on the control connection during a transfer.
(It's unclear from RFC 959 whether "NOOP" is even permitted during a transfer).

PR bin/56129

Revision 1.168.2.1 / (download) - annotate - [select for diffs], Fri Jan 29 20:58:19 2021 UTC (3 years, 1 month ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE
Changes since 1.168: +16 -6 lines
Diff to previous 1.168 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by lukem in ticket #1190):

	usr.bin/ftp/progressbar.c: revision 1.24
	usr.bin/ftp/ssl.c: revision 1.9
	usr.bin/ftp/progressbar.h: revision 1.9
	usr.bin/ftp/ftp.c: revision 1.171
	usr.bin/ftp/version.h: revision 1.92

ftp: don't use restartable signals

Refactor to not rely upon restartable signals (SA_RESTART),
possibly fixing intermittent failures with -q QUITTIME.
ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
instead of relying upon restartable signals.

http/https transfers: Explicitly print an error similar to
progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
and set errno to ETIMEDOUT so that the warn() in fetch_url()
prints a more accurate error message.

PR/55857

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jan 6 04:43:14 2021 UTC (3 years, 2 months ago) by lukem
Branch: MAIN
CVS Tags: cjep_sun2x-base, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: cjep_sun2x
Changes since 1.170: +16 -6 lines
Diff to previous 1.170 (colored) to selected 1.126.2.5 (colored)

ftp: don't use restartable signals

Refactor to not rely upon restartable signals (SA_RESTART),
possibly fixing intermittent failures with -q QUITTIME.

ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
instead of relying upon restartable signals.

http/https transfers: Explicitly print an error similar to
progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
and set errno to ETIMEDOUT so that the warn() in fetch_url()
prints a more accurate error message.

PR/55857

Revision 1.170 / (download) - annotate - [select for diffs], Sat Jul 11 02:19:31 2020 UTC (3 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.169: +39 -22 lines
Diff to previous 1.169 (colored) to selected 1.126.2.5 (colored)

ftp.c: improve signal handler restoration

Only invoke the old signal handler if it's a real signal handler
and not SIG_IGN, SIG_DFL, SIG_HOLD, or SIG_ERR, using new static
function issighandler().
Avoids an intermittent race condition with a null pointer
dereference via (*SIG_DFL)().
Bug class reported by Joyu Liao from Juniper Networks.

Use SIG_ERR instead of NULL as the indicator that a signal handler
hasn't been changed, so that SIG_DFL (equivalent to NULL)
will be restored.

Revision 1.169 / (download) - annotate - [select for diffs], Mon Jun 8 01:33:27 2020 UTC (3 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.168: +5 -5 lines
Diff to previous 1.168 (colored) to selected 1.126.2.5 (colored)

ftp: exit if lostpeer invoked by a signal

lostpeer() calls too many async-unsafe functions (both directly
and indirectly) to close and cleanup the remote connections,
so just exit after the cleanup if invoked by a signal.

Reported in private mail by Qi Hou.
May also resolve a crash reported by Thomas Klausner.

Revision 1.167.14.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:19 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored) next main 1.168 (colored) to selected 1.126.2.5 (colored)

Sync with HEAD

Revision 1.168 / (download) - annotate - [select for diffs], Mon Feb 4 04:09:13 2019 UTC (5 years, 1 month ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, is-mlppp-base, is-mlppp
Branch point for: netbsd-9
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored) to selected 1.126.2.5 (colored)

- add justquit() that always exits.  use it to avoid unreachable code.

Revision 1.166.2.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:25 2016 UTC (7 years, 4 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored) next main 1.167 (colored) to selected 1.126.2.5 (colored)

Sync with HEAD

Revision 1.167 / (download) - annotate - [select for diffs], Tue Oct 4 15:06:31 2016 UTC (7 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi, netbsd-8
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored) to selected 1.126.2.5 (colored)

When using data outside the signed char range, it is better to
consistently use an unsigned char buffer.

Revision 1.163.2.2 / (download) - annotate - [select for diffs], Sat Aug 27 13:57:01 2016 UTC (7 years, 7 months ago) by bouyer
Branch: netbsd-6
Changes since 1.163.2.1: +13 -3 lines
Diff to previous 1.163.2.1 (colored) to branchpoint 1.163 (colored) next main 1.164 (colored) to selected 1.126.2.5 (colored)

Apply patch, requested by nonaka in ticket #1375:
	src/usr.bin/ftp/cmds.c:		patch
	src/usr.bin/ftp/fetch.c:	patch
	src/usr.bin/ftp/ftp.1:		patch
	src/usr.bin/ftp/ftp.c:		patch
	src/usr.bin/ftp/ftp_var.h:	patch
	src/usr.bin/ftp/main.c:		patch
	src/usr.bin/ftp/ssl.c:		patch
	src/usr.bin/ftp/ssl.h:		patch
	src/usr.bin/ftp/version.h:	patch
Update ftp(1) to version 20150912, adding https via proxy support.

Revision 1.164.10.1 / (download) - annotate - [select for diffs], Sun Mar 13 11:49:14 2016 UTC (8 years ago) by martin
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.164: +13 -3 lines
Diff to previous 1.164 (colored) next main 1.165 (colored) to selected 1.126.2.5 (colored)

Pull up following revision(s) (requested by nonakap in ticket #1133):
	usr.bin/ftp/fetch.c: revision 1.208-1.221
	usr.bin/ftp/cmds.c: revision 1.136-1.137
	usr.bin/ftp/ssl.c: revision 1.5
	usr.bin/ftp/ftp.c: revision 1.165-1.166
	usr.bin/ftp/ftp_var.h: revision 1.84

Workaround const issues of SSL_set_tlsext_host_name.

Use the proper format "[IPv6 address]:port" when reporting connection
attempts to IPv6 endpoints.

(Hopefully) fix build without IPv6 support

Try to factor out some code, this is completely out of control.

Separate no_proxy handling.

Factor the proxy handling code out.

Fix compile failure without WITH_SSL.

PR/50438: NONAKA Kimihiro: ftp(1): CONNECT method support

make DPRINTF/DWARN always statements.

Fix to connect https via proxy.

Fix ttyout message.

Simplify and factor out connect message

Split the position/size parsing into a separate function.

Mark function as only needed with ssl.

Fix downloads of local files using file:// URLs

Initialize the token match pointer.

use sizeof() and array notation.
CID 1354295: Array overrun.

Revision 1.166 / (download) - annotate - [select for diffs], Sun Dec 13 14:06:13 2015 UTC (8 years, 3 months ago) by tron
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.165: +6 -2 lines
Diff to previous 1.165 (colored) to selected 1.126.2.5 (colored)

(Hopefully) fix build without IPv6 support

Revision 1.165 / (download) - annotate - [select for diffs], Fri Dec 11 08:37:31 2015 UTC (8 years, 3 months ago) by tron
Branch: MAIN
Changes since 1.164: +9 -3 lines
Diff to previous 1.164 (colored) to selected 1.126.2.5 (colored)

Use the proper format "[IPv6 address]:port" when reporting connection
attempts to IPv6 endpoints.

Revision 1.163.2.1 / (download) - annotate - [select for diffs], Tue Dec 17 21:07:59 2013 UTC (10 years, 3 months ago) by bouyer
Branch: netbsd-6
Changes since 1.163: +5 -4 lines
Diff to previous 1.163 (colored) to selected 1.126.2.5 (colored)

Apply patch, requested by tron in ticket #997:
	usr.bin/ftp/Makefile				patch
	usr.bin/ftp/cmds.c				patch
	usr.bin/ftp/cmdtab.c				patch
	usr.bin/ftp/extern.h				patch
	usr.bin/ftp/fetch.c				patch
	usr.bin/ftp/ftp.1				patch
	usr.bin/ftp/ftp.c				patch
	usr.bin/ftp/ftp_var.h				patch
	usr.bin/ftp/main.c				patch
	usr.bin/ftp/progressbar.c			patch
	usr.bin/ftp/ssl.c				patch
	usr.bin/ftp/ssl.h				patch
	usr.bin/ftp/util.c				patch
	usr.bin/ftp/version.h				patch

Add HTTPS support to ftp(1).

Revision 1.162.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 19:00:18 2012 UTC (11 years, 4 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.162.2.1: +5 -4 lines
Diff to previous 1.162.2.1 (colored) to branchpoint 1.162 (colored) next main 1.163 (colored) to selected 1.126.2.5 (colored)

sync with head

Revision 1.164 / (download) - annotate - [select for diffs], Wed Jul 4 06:09:37 2012 UTC (11 years, 8 months ago) by is
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, agc-symver-base, agc-symver
Branch point for: netbsd-7
Changes since 1.163: +5 -4 lines
Diff to previous 1.163 (colored) to selected 1.126.2.5 (colored)

As discussed on tech-net@: Don't display expected EHOSTUNREACH for all but
the last connect attempts in terse mode.

Revision 1.162.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:09:32 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.162: +5 -2 lines
Diff to previous 1.162 (colored) to selected 1.126.2.5 (colored)

sync with head

Revision 1.163 / (download) - annotate - [select for diffs], Sat Dec 10 05:53:58 2011 UTC (12 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: netbsd-6
Changes since 1.162: +5 -2 lines
Diff to previous 1.162 (colored) to selected 1.126.2.5 (colored)

Move determination of socket buffer sizes from startup to the first
time a socket is used, as the previous logic assumed AF_INET sockets
were available (which they may not be in an IPv6-only system).
Per discussion with Maxim Konovalov and the FreeBSD problem 162661.

Revision 1.162 / (download) - annotate - [select for diffs], Fri Sep 16 15:39:26 2011 UTC (12 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.161: +6 -5 lines
Diff to previous 1.161 (colored) to selected 1.126.2.5 (colored)

Use __dead

Revision 1.161 / (download) - annotate - [select for diffs], Sun Aug 14 12:58:15 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.160: +17 -10 lines
Diff to previous 1.160 (colored) to selected 1.126.2.5 (colored)

fix gcc-4.5 warnings

Revision 1.160 / (download) - annotate - [select for diffs], Fri Mar 5 07:41:10 2010 UTC (14 years ago) by lukem
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored) to selected 1.126.2.5 (colored)

Back to using 'RFC xxxx' instead of 'RFCxxxx'

Revision 1.156.6.1 / (download) - annotate - [select for diffs], Wed May 13 19:19:50 2009 UTC (14 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.156: +22 -22 lines
Diff to previous 1.156 (colored) next main 1.157 (colored) to selected 1.126.2.5 (colored)

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html

Revision 1.159 / (download) - annotate - [select for diffs], Wed Apr 15 03:42:33 2009 UTC (14 years, 11 months ago) by jld
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.158: +4 -3 lines
Diff to previous 1.158 (colored) to selected 1.126.2.5 (colored)

Unbreak the build by adding curly braces to placate the empty-body warning.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Apr 12 10:18:52 2009 UTC (14 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.157: +11 -11 lines
Diff to previous 1.157 (colored) to selected 1.126.2.5 (colored)

Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).

Revision 1.157 / (download) - annotate - [select for diffs], Sun Apr 12 07:07:41 2009 UTC (14 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.156: +11 -12 lines
Diff to previous 1.156 (colored) to selected 1.126.2.5 (colored)

fix -Wshadow issues

Revision 1.155.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:32:11 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.155: +33 -19 lines
Diff to previous 1.155 (colored) next main 1.156 (colored) to selected 1.126.2.5 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.153.6.1 / (download) - annotate - [select for diffs], Sun May 18 12:36:05 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.153: +50 -40 lines
Diff to previous 1.153 (colored) next main 1.154 (colored) to selected 1.126.2.5 (colored)

sync with head.

Revision 1.156 / (download) - annotate - [select for diffs], Sat May 10 00:05:31 2008 UTC (15 years, 10 months ago) by skd
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, hpcarm-cleanup-nbase
Branch point for: jym-xensuspend
Changes since 1.155: +33 -19 lines
Diff to previous 1.155 (colored) to selected 1.126.2.5 (colored)

Add epsv6 and epsv to disable extended passive mode for ipv6 or both ipv4 and ipv6 respectively.  This hack is due to our friends a Juniper Networks who break
epsv in ipv6.  Should be fixed in ScreenOS 6.2.X.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:13 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.154: +2 -9 lines
Diff to previous 1.154 (colored) to selected 1.126.2.5 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.154 / (download) - annotate - [select for diffs], Tue Apr 22 12:59:33 2008 UTC (15 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.153: +19 -16 lines
Diff to previous 1.153 (colored) to selected 1.126.2.5 (colored)

Use the service name to getaddrinfo() (along with the host name), so that
features such as DNS Service Discovery have a better chance of working.
Suggested by David Young <dyoung>.

Display the service name in various status & error messages.

Don't getservbyname() the :port component of a URL; RFC 3986 says it's
just an unsigned number, not a service name.

Revision 1.152.4.1 / (download) - annotate - [select for diffs], Wed Jan 9 02:00:39 2008 UTC (16 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.152: +5 -5 lines
Diff to previous 1.152 (colored) next main 1.153 (colored) to selected 1.126.2.5 (colored)

sync with HEAD

Revision 1.153 / (download) - annotate - [select for diffs], Wed Dec 5 00:15:25 2007 UTC (16 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-pf42
Changes since 1.152: +5 -5 lines
Diff to previous 1.152 (colored) to selected 1.126.2.5 (colored)

Rename HAVE_STRUCT_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
to accurately reflect the structure member being used.

Revision 1.152.6.2 / (download) - annotate - [select for diffs], Sun Jul 22 05:02:51 2007 UTC (16 years, 8 months ago) by lukem
Branch: matt-mips64
Changes since 1.152.6.1: +2131 -0 lines
Diff to previous 1.152.6.1 (colored) to branchpoint 1.152 (colored) next main 1.153 (colored) to selected 1.126.2.5 (colored)

Replace  HAVE_SOCKADDR_SA_LEN  with  defined(HAVE_STRUCT_SOCKADDR_SA_LEN)

Revision 1.152.6.1, Sun Jul 22 05:02:50 2007 UTC (16 years, 8 months ago) by lukem
Branch: matt-mips64
Changes since 1.152: +0 -2131 lines
FILE REMOVED

file ftp.c was added on branch matt-mips64 on 2007-07-22 05:02:51 +0000

Revision 1.152 / (download) - annotate - [select for diffs], Sun Jul 22 05:02:50 2007 UTC (16 years, 8 months ago) by lukem
Branch: MAIN
CVS Tags: matt-mips64-base, matt-armv6-prevmlocking, hpcarm-cleanup
Branch point for: matt-mips64, matt-armv6
Changes since 1.151: +5 -5 lines
Diff to previous 1.151 (colored) to selected 1.126.2.5 (colored)

Replace  HAVE_SOCKADDR_SA_LEN  with  defined(HAVE_STRUCT_SOCKADDR_SA_LEN)

Revision 1.151 / (download) - annotate - [select for diffs], Thu May 24 05:05:19 2007 UTC (16 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.150: +4 -3 lines
Diff to previous 1.150 (colored) to selected 1.126.2.5 (colored)

Display times in RFC2822 form rather than using ctime(3), since
the former is more explicit about the timezone offset.

Revision 1.150 / (download) - annotate - [select for diffs], Tue May 15 23:54:19 2007 UTC (16 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.149: +4 -4 lines
Diff to previous 1.149 (colored) to selected 1.126.2.5 (colored)

* Modify parse_url() to consistently strip the leading `/' off ftp URLs.
  Fixes PR 17617.
* Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be
  consistent with the style in the RFC index.
* Refer to RFC3916 instead of 1738 or 2732.
* Expand the list of supported RFCs in ftp(1) to contain the document
  name as well.

Revision 1.149 / (download) - annotate - [select for diffs], Thu May 10 05:17:10 2007 UTC (16 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.148: +104 -141 lines
Diff to previous 1.148 (colored) to selected 1.126.2.5 (colored)

Implement copy_bytes() to copy bytes from one fd to another via the
provided buffer, with optional rate-limiting and hash-mark printing,
using one loop and handle short writes.
Refactor sendrequest() and recvrequest() to use copy_data().
Addresses PR 15943.

Revision 1.148 / (download) - annotate - [select for diffs], Wed Apr 18 01:50:45 2007 UTC (16 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.147: +6 -5 lines
Diff to previous 1.147 (colored) to selected 1.126.2.5 (colored)

fix rev 1.144: initconn() may be called with verbose==-1 (e.g., during remote
completion), so only print out the successful EPSV response if verbose>0.

Revision 1.147 / (download) - annotate - [select for diffs], Tue Apr 17 05:52:03 2007 UTC (16 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.146: +70 -79 lines
Diff to previous 1.146 (colored) to selected 1.126.2.5 (colored)

* Implement -s srcaddr; uses srcaddr as the local IP address for all
  connections.
  Based on code in the version of ftp that FreeBSD had before they
  replaced it with lukemftp.
* Move error message handling into ftp_connect() rather than in the
  caller, so that more specific error reporting can occur.
* Improve consistency of various warning and error messages.

Revision 1.146 / (download) - annotate - [select for diffs], Mon Apr 16 00:43:43 2007 UTC (16 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.145: +4 -4 lines
Diff to previous 1.145 (colored) to selected 1.126.2.5 (colored)

Replace a "while" with an "if" since the code path only gets executed once.

Revision 1.145 / (download) - annotate - [select for diffs], Thu Apr 12 04:18:23 2007 UTC (16 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.126.2.5 (colored)

whitespace pedantry

Revision 1.144 / (download) - annotate - [select for diffs], Wed Apr 11 05:03:25 2007 UTC (16 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.143: +25 -4 lines
Diff to previous 1.143 (colored) to selected 1.126.2.5 (colored)

Suppress printing non-COMPLETE reply strings from EPSV and EPRT, as we're
going to fall back to PASV / PORT (respectively) if the former fail,
and this avoids printing a failure reply followed by a success reply.
Should fix a problem with the emacs ftp wrapper.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Dec 13 18:04:08 2006 UTC (17 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.142: +23 -40 lines
Diff to previous 1.142 (colored) to selected 1.126.2.5 (colored)

gcc4 does not care about &foo; use volatile instead. From Anon Ymous

Revision 1.142 / (download) - annotate - [select for diffs], Mon Oct 23 19:53:24 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4
Changes since 1.141: +14 -11 lines
Diff to previous 1.141 (colored) to selected 1.126.2.5 (colored)

simplify 421 printing code (jani at xeebioneurope dot de)

Revision 1.141 / (download) - annotate - [select for diffs], Sat Oct 7 10:49:14 2006 UTC (17 years, 5 months ago) by elad
Branch: MAIN
Changes since 1.140: +4 -3 lines
Diff to previous 1.140 (colored) to selected 1.126.2.5 (colored)

PR/32855: der Mouse: [dM] ftp -q is broken (or misdocumented)

Patch applied, thanks!

Revision 1.140 / (download) - annotate - [select for diffs], Wed May 10 21:53:20 2006 UTC (17 years, 10 months ago) by mrg
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.139: +3 -2 lines
Diff to previous 1.139 (colored) to selected 1.126.2.5 (colored)

quell GCC 4.1 uninitialised variable warnings.

XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..

Revision 1.139 / (download) - annotate - [select for diffs], Fri Apr 28 20:06:50 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.138: +3 -3 lines
Diff to previous 1.138 (colored) to selected 1.126.2.5 (colored)

Coverity CID 874: Don't check local; it cannot be NULL.

Revision 1.138 / (download) - annotate - [select for diffs], Fri Apr 28 20:05:43 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.137: +3 -3 lines
Diff to previous 1.137 (colored) to selected 1.126.2.5 (colored)

Coverity CID 875: local is not allowed to be NULL; don't check for it.

Revision 1.137 / (download) - annotate - [select for diffs], Tue Jan 31 20:05:36 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.136: +4 -4 lines
Diff to previous 1.136 (colored) to selected 1.126.2.5 (colored)

rename debug to ftp_debug. grr libssh.

Revision 1.136 / (download) - annotate - [select for diffs], Tue Jan 31 20:01:23 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.135: +9 -9 lines
Diff to previous 1.135 (colored) to selected 1.126.2.5 (colored)

Rename xfoo() to ftp_foo() to avoid collisions with libssh. Don't ask.

Revision 1.126.2.9 / (download) - annotate - [select for diffs], Sun Jul 24 10:33:09 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Changes since 1.126.2.8: +27 -28 lines
Diff to previous 1.126.2.8 (colored) to branchpoint 1.126 (colored) next main 1.127 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.135 (requested by lukem in ticket #606):
Add NO_USAGE and NO_DEBUG so that we can fit in the floppies again.

Revision 1.126.2.8 / (download) - annotate - [select for diffs], Sun Jul 24 10:30:37 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.126.2.7: +3 -3 lines
Diff to previous 1.126.2.7 (colored) to branchpoint 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.134 (requested by lukem in ticket #606):
Implement:
    int getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
	Read a line from the FILE stream into buf/buflen using fgets(), so up
	to buflen-1 chars will be read and the result will be NUL terminated.
	If the line has a trailing newline it will be removed.
	If the line is too long, excess characters will be read until
	newline/EOF/error.
	Various -ve return values indicate different errors, and errormsg
	will be changed to an error description if it's not NULL.
Convert to use getline() instead of fgets() whenever reading user input
to ensure that an overly long input line doesn't leave excess characters
for the next input operation to accidentally use as input.
Zero out the password & account after we've finished with it.
Consistently use getpass(3) (i.e, character echo suppressed) when
reading the account data.  For some reason, historically the "login"
code suppressed echo for Account: yet the "user" command did not!
Display the hostname in the "getaddrinfo failed" warning.
Appease some -Wcast-qual warnings.  Fixing all of these requires
significant code refactoring.  (mmm, legacy code).

Revision 1.126.2.7 / (download) - annotate - [select for diffs], Sun Jul 24 10:27:31 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.126.2.6: +6 -10 lines
Diff to previous 1.126.2.6 (colored) to branchpoint 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.133 (requested by lukem in ticket #606):
* Only print the "Trying <address>..." message if verbose and
  there's more than one struct addrinfo in the getaddrinfo() result.
* Don't use non-standard "u_int".

Revision 1.126.2.6 / (download) - annotate - [select for diffs], Sun Jul 24 10:17:43 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.126.2.5: +11 -8 lines
Diff to previous 1.126.2.5 (colored) to branchpoint 1.126 (colored)

Pull up revision 1.132 (requested by lukem in ticket #606):
Fix some cast issues highlighted by Scott Reynolds using gcc 4 on OSX.4

Revision 1.135 / (download) - annotate - [select for diffs], Wed Jun 29 02:31:19 2005 UTC (18 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.134: +27 -28 lines
Diff to previous 1.134 (colored) to selected 1.126.2.5 (colored)

Add NO_USAGE and NO_DEBUG so that we can fit in the floppies again.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Jun 10 00:18:46 2005 UTC (18 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored) to selected 1.126.2.5 (colored)

Implement:
    int getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
	Read a line from the FILE stream into buf/buflen using fgets(), so up
	to buflen-1 chars will be read and the result will be NUL terminated.
	If the line has a trailing newline it will be removed.
	If the line is too long, excess characters will be read until
	newline/EOF/error.
	Various -ve return values indicate different errors, and errormsg
	will be changed to an error description if it's not NULL.

Convert to use getline() instead of fgets() whenever reading user input
to ensure that an overly long input line doesn't leave excess characters
for the next input operation to accidentally use as input.

Zero out the password & account after we've finished with it.

Consistently use getpass(3) (i.e, character echo suppressed) when
reading the account data.  For some reason, historically the "login"
code suppressed echo for Account: yet the "user" command did not!

Display the hostname in the "getaddrinfo failed" warning.

Appease some -Wcast-qual warnings.  Fixing all of these requires
significant code refactoring.  (mmm, legacy code).

Revision 1.133 / (download) - annotate - [select for diffs], Wed Jun 1 12:10:14 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.132: +6 -10 lines
Diff to previous 1.132 (colored) to selected 1.126.2.5 (colored)

* Only print the "Trying <address>..." message if verbose and
  there's more than one struct addrinfo in the getaddrinfo() result.
* Don't use non-standard "u_int".

Revision 1.126.2.5 / (download) - annotate - [selected], Wed May 18 04:22:06 2005 UTC (18 years, 10 months ago) by snj
Branch: netbsd-3
Changes since 1.126.2.4: +5 -5 lines
Diff to previous 1.126.2.4 (colored) to branchpoint 1.126 (colored)

Pull up revision 1.131 (requested by lukem in ticket #301):
* Correct the "optlen" argument passed to getsockopt(3) and setsockopt(3)
  in various places.  Fixes a problem noted by Allen Briggs.
* Improve warning printed when connect(2) for the data channel fails.

Revision 1.126.2.4 / (download) - annotate - [select for diffs], Wed May 18 04:10:42 2005 UTC (18 years, 10 months ago) by snj
Branch: netbsd-3
Changes since 1.126.2.3: +37 -30 lines
Diff to previous 1.126.2.3 (colored) to branchpoint 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.130 (requested by lukem in ticket #318):
Use socklen_t instead of int as the 5th argument to getsockopt().
Improve invocation of setsockopt() and associated failure messages.

Revision 1.132 / (download) - annotate - [select for diffs], Sat May 14 15:26:43 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.131: +13 -10 lines
Diff to previous 1.131 (colored) to selected 1.126.2.5 (colored)

Fix some cast issues highlighted by Scott Reynolds using gcc 4 on OSX.4

Revision 1.131 / (download) - annotate - [select for diffs], Fri May 13 05:03:49 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.130: +7 -7 lines
Diff to previous 1.130 (colored) to selected 1.126.2.5 (colored)

* Correct the "optlen" argument passed to getsockopt(3) and setsockopt(3)
  in various places.  Fixes a problem noted by Allen Briggs.
* Improve warning printed when connect(2) for the data channel fails.

Revision 1.130 / (download) - annotate - [select for diffs], Wed May 11 02:29:12 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.129: +37 -30 lines
Diff to previous 1.129 (colored) to selected 1.126.2.5 (colored)

Use socklen_t instead of int as the 5th argument to getsockopt().
Improve invocation of setsockopt() and associated failure messages.

Revision 1.126.2.3 / (download) - annotate - [select for diffs], Mon May 9 17:12:14 2005 UTC (18 years, 10 months ago) by tron
Branch: netbsd-3
Changes since 1.126.2.2: +3 -3 lines
Diff to previous 1.126.2.2 (colored) to branchpoint 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.129 (requested by lukem in ticket #266):
typo in previous

Revision 1.126.2.2 / (download) - annotate - [select for diffs], Mon May 9 17:05:19 2005 UTC (18 years, 10 months ago) by tron
Branch: netbsd-3
Changes since 1.126.2.1: +11 -11 lines
Diff to previous 1.126.2.1 (colored) to branchpoint 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.128 (requested by lukem in ticket #266):
gratuitous whitespace cleanup (before someone else jumps the gun...)

Revision 1.126.2.1 / (download) - annotate - [select for diffs], Mon May 9 17:01:49 2005 UTC (18 years, 10 months ago) by tron
Branch: netbsd-3
Changes since 1.126: +63 -48 lines
Diff to previous 1.126 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.127 (requested by lukem in ticket #265):
Implement a timeout on the accept(2) in dataconn() and the
connect(2) in xconnect() by temporarily setting O_NONBLOCK
on the socket and using xpoll() to wait for the operation
to succeed.
The timeout used is the '-q quittime' argument (defaults to
60s for accept(2), and the system default for connect(2)).
Idea inspired by discussion with Chuck Cranor.
This may (indirectly) fix various problems with timeouts
in active mode through broken firewalls.
Implement xpoll() as a wrapper around poll(2), to make it
easier to replace on systems without a functional poll(2).
Unconditionally use xpoll() instead of conditionally using
select(2) or poll(2).

Revision 1.129 / (download) - annotate - [select for diffs], Mon Apr 11 05:47:56 2005 UTC (18 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored) to selected 1.126.2.5 (colored)

typo in previous

Revision 1.128 / (download) - annotate - [select for diffs], Mon Apr 11 01:49:31 2005 UTC (18 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.127: +11 -11 lines
Diff to previous 1.127 (colored) to selected 1.126.2.5 (colored)

gratuitous whitespace cleanup (before someone else jumps the gun...)

Revision 1.127 / (download) - annotate - [select for diffs], Mon Apr 11 01:43:31 2005 UTC (18 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.126: +63 -48 lines
Diff to previous 1.126 (colored) to selected 1.126.2.5 (colored)

Implement a timeout on the accept(2) in dataconn() and the
connect(2) in xconnect() by temporarily setting O_NONBLOCK
on the socket and using xpoll() to wait for the operation
to succeed.
The timeout used is the '-q quittime' argument (defaults to
60s for accept(2), and the system default for connect(2)).
Idea inspired by discussion with Chuck Cranor.
This may (indirectly) fix various problems with timeouts
in active mode through broken firewalls.

Implement xpoll() as a wrapper around poll(2), to make it
easier to replace on systems without a functional poll(2).
Unconditionally use xpoll() instead of conditionally using
select(2) or poll(2).

Revision 1.126 / (download) - annotate - [select for diffs], Tue Jul 20 10:40:22 2004 UTC (19 years, 8 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-3-base
Branch point for: netbsd-3
Changes since 1.125: +11 -5 lines
Diff to previous 1.125 (colored) to selected 1.126.2.5 (colored)

If an ftp auto-fetch transfer is interrupted by SIGINT (usually ^C),
exit with 130 instead of 1 (or rarely, 0).
This allows an ftp auto-fetch in a shell loop to correctly terminate the loop.
Should fix PR [pkg/26351], and possibly others.

Revision 1.125 / (download) - annotate - [select for diffs], Sat Apr 10 12:21:39 2004 UTC (19 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.124: +3 -8 lines
Diff to previous 1.124 (colored) to selected 1.126.2.5 (colored)

If connect(2) in xconnect() fails with EINTR, call select(2) on the socket
until it's writable or it fails with something other than EINTR.
This matches the behaviour in SUSv3, and prevents the problem when
pressing ^T (SIGINFO, which is marked as restartable) during connection
setup would cause ftp to fail with EADDRINUSE or EALREADY when the
second connect(2) was attempted on the same socket.
Problem found and solution provided by Maxime Henrion <mux@freebsd.org>.

Revision 1.124 / (download) - annotate - [select for diffs], Sat Apr 10 12:02:43 2004 UTC (19 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.123: +6 -6 lines
Diff to previous 1.123 (colored) to selected 1.126.2.5 (colored)

whitespace consistency tweak

Revision 1.123 / (download) - annotate - [select for diffs], Wed Dec 10 12:34:28 2003 UTC (20 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.122: +14 -8 lines
Diff to previous 1.122 (colored) to selected 1.126.2.5 (colored)

Don't warn about "ignored setsockopt" failures unless debugging is
enabled.  Suggested by Todd Vierling.

Allow empty passwords in ftp://user:@host/file auto-fetch URLs,
per RFC 1738.  Requested by Simon Poole.

Update version.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Aug 7 11:13:55 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.121: +3 -7 lines
Diff to previous 1.121 (colored) to selected 1.126.2.5 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Jul 31 07:06:41 2003 UTC (20 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.120: +3 -2 lines
Diff to previous 1.120 (colored) to selected 1.126.2.5 (colored)

Invalidate remote directory completion cache if any command which
may change the remote contents completes successfully, including:
del, mdel, ren, mkdir, rmdir, quote, and all upload commands
Patch from Yar Tikhiy <yar@comp.chem.msu.su>.

Revision 1.120 / (download) - annotate - [select for diffs], Wed Jun 5 10:20:49 2002 UTC (21 years, 9 months ago) by lukem
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored) to selected 1.126.2.5 (colored)

- when showing the final progress bar, replace "00:00 ETA" with the
  elapsed time.  (suggested by simonb)
- actually display transfer stats after a URL fetch. (bug introduced a
  *long* time ago)
- update copyright & version

Revision 1.119 / (download) - annotate - [select for diffs], Tue May 7 02:04:09 2002 UTC (21 years, 10 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored) to selected 1.126.2.5 (colored)

Use "r+" instead of "r+w", since the latter is not standard.
Noted by <Steve.McClellan@radisys.com> in private email.

Revision 1.100.2.2 / (download) - annotate - [select for diffs], Fri Apr 26 13:20:54 2002 UTC (21 years, 11 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.100.2.1: +6 -5 lines
Diff to previous 1.100.2.1 (colored) to branchpoint 1.100 (colored) next main 1.101 (colored) to selected 1.126.2.5 (colored)

Pull up revision 1.118 (requested by itojun):
  Avoid buffer overrun on PASV response from a malicious server.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Apr 25 10:55:43 2002 UTC (21 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.117: +6 -5 lines
Diff to previous 1.117 (colored) to selected 1.126.2.5 (colored)

avoid buffer overrun on PASV from malicious server.
http://online.securityfocus.com/archive/1/269356/2002-04-22/2002-04-28/0

Revision 1.117 / (download) - annotate - [select for diffs], Wed Dec 26 09:40:16 2001 UTC (22 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.116: +3 -3 lines
Diff to previous 1.116 (colored) to selected 1.126.2.5 (colored)

update copyrights

Revision 1.116 / (download) - annotate - [select for diffs], Sun Dec 23 12:23:02 2001 UTC (22 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored) to selected 1.126.2.5 (colored)

Add -4 to force IPv4 and -6 to force IPv6 address usage.
From Hajimu UMEMOTO, via Mike Heffner of FreeBSD.

(FreeBSD has imported NetBSD's ftp as their ftp client;
Mike is sending back some of their local changes).

Revision 1.115 / (download) - annotate - [select for diffs], Thu Dec 20 05:45:37 2001 UTC (22 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.114: +7 -8 lines
Diff to previous 1.114 (colored) to selected 1.126.2.5 (colored)

Large file ASCII mode support by using fseeko() instead of fseek().
From Andrey A. Chernov of FreeBSD, via Mike Heffner.

Revision 1.114 / (download) - annotate - [select for diffs], Mon Feb 19 18:15:29 2001 UTC (23 years, 1 month ago) by lukem
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored) to selected 1.126.2.5 (colored)

minor knf

Revision 1.113 / (download) - annotate - [select for diffs], Mon Nov 27 16:08:03 2000 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.112: +4 -2 lines
Diff to previous 1.112 (colored) to selected 1.126.2.5 (colored)

fix INET6-less build (like x_ftp).  PR11578

Revision 1.112 / (download) - annotate - [select for diffs], Fri Nov 24 13:01:24 2000 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.111: +18 -12 lines
Diff to previous 1.111 (colored) to selected 1.126.2.5 (colored)

cope with 2553bis getnameinfo (always attach scope id)
getnameinfo error check.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Nov 15 04:09:19 2000 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.110: +4 -6 lines
Diff to previous 1.110 (colored) to selected 1.126.2.5 (colored)

use NI_MAXHOST with getnameinfo.  we can assume presense of getnameinfo.

Revision 1.100.2.1 / (download) - annotate - [select for diffs], Wed Oct 18 01:32:43 2000 UTC (23 years, 5 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.100: +12 -7 lines
Diff to previous 1.100 (colored) to selected 1.126.2.5 (colored)

Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.

Revision 1.110 / (download) - annotate - [select for diffs], Wed Oct 11 14:46:03 2000 UTC (23 years, 5 months ago) by is
Branch: MAIN
Changes since 1.109: +12 -7 lines
Diff to previous 1.109 (colored) to selected 1.126.2.5 (colored)

More format string cleanup by sommerfeld.

Revision 1.109 / (download) - annotate - [select for diffs], Thu Sep 28 12:29:24 2000 UTC (23 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored) to selected 1.126.2.5 (colored)

explicitly use SOCK_STREAM with socket() instead of res->ai_socktype,
because it appears that linux with glibc doesn't set the latter
correctly after one of getaddrinfo() or getnameinfo().

Revision 1.108 / (download) - annotate - [select for diffs], Sun Aug 6 08:51:22 2000 UTC (23 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.107: +7 -5 lines
Diff to previous 1.107 (colored) to selected 1.126.2.5 (colored)

* implement parseport(), which takes a string and attempts to convert
  it to a numeric port number
* use parseport() in parse_url() and hookup()
* don't try and lookup the port number using getaddrinfo(), as it's too hard
  to separate a failed host name lookup from a failed service name lookup.
  this was causing lossage on systems that don't have `http' in services(5)
  (such as solaris), but only crept in when we started using getaddrinfo()
  unconditionally.

Revision 1.107 / (download) - annotate - [select for diffs], Tue Aug 1 22:47:28 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.106: +9 -9 lines
Diff to previous 1.106 (colored) to selected 1.126.2.5 (colored)

- rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* (unsigned)
  equivalents. name change suggested by Klaus Klein <kjk@netbsd.org>
- change defined(BSD4_4) || HAVE_SIN_LEN tests into HAVE_SOCKADDR_SA_LEN,
  and set the latter if BSD4_4 exists

Revision 1.106 / (download) - annotate - [select for diffs], Mon Jul 31 00:56:07 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.105: +11 -11 lines
Diff to previous 1.105 (colored) to selected 1.126.2.5 (colored)

- we can't just rename BSD4_4 -> HAVE_SIN_LEN, since bsd systems define BSD4_4;
  change tests to test for either defined(BSD4_4) or HAVE_SIN_LEN
- more KNF

Revision 1.105 / (download) - annotate - [select for diffs], Sun Jul 30 09:32:09 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.104: +9 -8 lines
Diff to previous 1.104 (colored) to selected 1.126.2.5 (colored)

* always set (struct sockinet).su_len after getsockname() et al, so
  that it's valid on systems which don't have sin_len and need the `compat'
  version
* fix the accept() in dataconn() to use the correct struct elem

Revision 1.104 / (download) - annotate - [select for diffs], Sun Jul 30 06:10:44 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.103: +44 -132 lines
Diff to previous 1.103 (colored) to selected 1.126.2.5 (colored)

* always use getaddrinfo() and getnameinfo() instead of maintaining two code
  paths. (lukemftp will provide replacements for these on older systems)
* rename __USE_SELECT to USE_SELECT
* rename BSD4_4 to HAVE_SIN_LEN
* replace union sockunion {} with struct sockinet {}, and modify the code
  accordingly. this is possibly more portable, as it doesn't rely upon the
  structure alignment within the union for our own stuff.
  (XXX: haven't tested the ipv6 stuff)

Revision 1.103 / (download) - annotate - [select for diffs], Sun Jul 30 04:42:37 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.102: +8 -25 lines
Diff to previous 1.102 (colored) to selected 1.126.2.5 (colored)

clean up NO_QUAD support: create helper #defines and use as appropriate:
	#define		NOQUAD		! NOQUAD
	-------		------		- ------
	QUADF		"%ld"		"%lld"
	QUADFP(x)	"%" x "ld"	"%" x "lld"
	QUADT		long		long long
	STRTOL(x,y,z)	strtol(x,y,z)	strtoll(x,y,z)

Revision 1.102 / (download) - annotate - [select for diffs], Tue Jul 18 07:16:54 2000 UTC (23 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.101: +21 -23 lines
Diff to previous 1.101 (colored) to selected 1.126.2.5 (colored)

add support for FEAT and OPTS commands with `features' and `opts'.
(from RFC 2389).

add support for MLST & MLSD (machine parseble listings) with 'mlst', 'mlsd'
and 'pmlsd' (mlsd |$PAGER) commands.  (from draft-ietf-ftpext-mlst-11)

rename remotesyst() to getremoteinfo(), and modify to parse the result from
FEAT (if supported), and take into account the support for the various
extensions such as MDTM, SIZE, REST (STREAM), MLSD, and FEAT/OPTS.
put each feature into one of the following categories:
	- known to work (explicit FEAT)
	- unknown but assume works until explicit failure, when it's
	  then tagged as `known not to work'.
	- known not to work (FEAT succeeded but didn't return anything,
	  or was unknown and then explicit failure)
assign results into features[] matrix.

add support to getreply() so that an optional callback will be called
for each line received from the server except for the first and last.
this is used in FEAT (and MLST) parsing.

modify various commands to check if REST (STREAM), MDTM and SIZE are
explicitly or implicitly supported before using.

fix `syst' when verbose is off.

minor knf (indent goto labels by one space, etc).

simply various command usage handlers by assuming that argv != NULL except
for quit() and disconnect().

Revision 1.101 / (download) - annotate - [select for diffs], Fri Jul 7 15:13:24 2000 UTC (23 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.100: +5 -5 lines
Diff to previous 1.100 (colored) to selected 1.126.2.5 (colored)

errx?/warnx? audit.  do not pass variable alone, use %s.  idea from openbsd

Revision 1.95.2.1 / (download) - annotate - [select for diffs], Fri Jun 23 16:30:23 2000 UTC (23 years, 9 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.95: +60 -10 lines
Diff to previous 1.95 (colored) next main 1.96 (colored) to selected 1.126.2.5 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jun 11 15:15:52 2000 UTC (23 years, 9 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-ALPHA2
Branch point for: netbsd-1-5
Changes since 1.99: +8 -10 lines
Diff to previous 1.99 (colored) to selected 1.126.2.5 (colored)

from itojun: better fix for previous (doesn't need in_addr_t or u_int32_t)

Revision 1.99 / (download) - annotate - [select for diffs], Sun Jun 11 02:12:05 2000 UTC (23 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.98: +11 -7 lines
Diff to previous 1.98 (colored) to selected 1.126.2.5 (colored)

portability fixes for lukemftp:
* initconn(): use in_addr_t instead of u_int32_t when manipulating IPv6
  addresses (and assume anything with ipv6 has in_addr_t; if not, i'll
  add an autoconf test for it)
* ai_unmapped(): not all systems have sin_len; so only set #ifdef BSD4_4
* fix some lint

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jun 5 09:22:53 2000 UTC (23 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.97: +4 -2 lines
Diff to previous 1.97 (colored) to selected 1.126.2.5 (colored)

- fix ai_unmapped() to be a no-op in the !def INET6 case
- display `(-INET6)' at the end of the version string if !def INET6
- clarify in the man page that IPv6 support may not be present (for lukemftp :)

Revision 1.97 / (download) - annotate - [select for diffs], Tue May 30 02:11:42 2000 UTC (23 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.96: +14 -2 lines
Diff to previous 1.96 (colored) to selected 1.126.2.5 (colored)

more comment on IPv4 mapped address handling.

Revision 1.96 / (download) - annotate - [select for diffs], Mon May 29 14:57:28 2000 UTC (23 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.95: +36 -2 lines
Diff to previous 1.95 (colored) to selected 1.126.2.5 (colored)

convert IPv4 mapped address (::ffff:10.1.1.1) into real IPv4 address
before touching it.  IPv4 mapped address complicates too many things
in FTP protocol handling.

Revision 1.95 / (download) - annotate - [select for diffs], Mon May 1 10:35:18 2000 UTC (23 years, 11 months ago) by lukem
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.94: +25 -68 lines
Diff to previous 1.94 (colored) to selected 1.126.2.5 (colored)

convert to ANSI KNF

Revision 1.94 / (download) - annotate - [select for diffs], Mon May 1 09:44:55 2000 UTC (23 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored) to selected 1.126.2.5 (colored)

* Add support for `fget localfile', which reads a list of filenames to
  retrieve from localfile.  Based on work by Darren Reed.
* Crank version.
* Update copyright dates.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Mar 14 16:36:05 2000 UTC (24 years ago) by itojun
Branch: MAIN
Changes since 1.92: +5 -5 lines
Diff to previous 1.92 (colored) to selected 1.126.2.5 (colored)

inhibit too-noisy message for scoped address data transfer
(will be enabled in "debug" mode).

Revision 1.92 / (download) - annotate - [select for diffs], Mon Feb 28 10:12:27 2000 UTC (24 years, 1 month ago) by lukem
Branch: MAIN
Changes since 1.91: +10 -2 lines
Diff to previous 1.91 (colored) to selected 1.126.2.5 (colored)

only use IPTOS_ setsockopt()s if they're defined (e.g, SunOS doesn't).
from Havard.Eidnes@runit.sintef.no

Revision 1.91 / (download) - annotate - [select for diffs], Mon Feb 14 21:46:27 2000 UTC (24 years, 1 month ago) by lukem
Branch: MAIN
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored) to selected 1.126.2.5 (colored)

only use getaddrinfo() et al if both NI_NUMERICHOST *and* INET6 are defined...
(allows --disable-ipv6 in lukemftp's configure script to disable this as
well, which is good for testing when it appears getaddrinfo() is borken)

Revision 1.90 / (download) - annotate - [select for diffs], Mon Jan 31 22:01:04 2000 UTC (24 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.89: +8 -8 lines
Diff to previous 1.89 (colored) to selected 1.126.2.5 (colored)

define private type `sigfunc' as
	typedef void (*sigfunc) __P((int));
and replace use of sig_t and void (*)(int).

certain other OSes define sig_t differently to that (they add extra arguments),
and it causes problems due to function mismatches, etc...

Revision 1.64.2.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:36:58 1999 UTC (24 years, 3 months ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.64: +459 -369 lines
Diff to previous 1.64 (colored) next main 1.65 (colored) to selected 1.126.2.5 (colored)

Pull up to last week's -current.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Dec 11 02:02:21 1999 UTC (24 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.88: +78 -40 lines
Diff to previous 1.88 (colored) to selected 1.126.2.5 (colored)

separate out the main `data pump' loop into two: one that supports
rate limiting and one that doesn't. simplifies the code, and speeds
up the latter case a bit, at the expense of duplicating a few lines...

Revision 1.88 / (download) - annotate - [select for diffs], Fri Nov 26 21:41:56 1999 UTC (24 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.87: +3 -13 lines
Diff to previous 1.87 (colored) to selected 1.126.2.5 (colored)

* complete_remote(): use remglob("", ...) instead of remglob(".", ...),
  for listings of the current working directory; some ftp servers don't
  like `NLST .'.
  [noted by Giles Lean <giles@nemeton.com.au>]
* recvrequest(): treat remote=="" as remote==NULL when calling command().
  (to support the above change)
* support `[user@]' in `[user@]host' and `[user@]host[:][path]'.
  [based on idea (and initial code) from David Maxwell <david@fundy.ca>]
* `idle' may be invoked without any args
* reformat some comments
* reformat usage string in program and man page
* call updateremotepwd() after successful login, not after successful connect
* always call setsockopt(, IPPROTO_IP, IP_TOS, ) (et al); using #if
  defined(IPPROTO_IP) doesn't work on certain foreign systems where
  enums instead of #defines are used...
  [noted by Matthias Pfaller <leo@dachau.marco.de>]

Revision 1.87 / (download) - annotate - [select for diffs], Thu Nov 11 01:19:12 1999 UTC (24 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored) to selected 1.126.2.5 (colored)

whitespace nits

Revision 1.86 / (download) - annotate - [select for diffs], Wed Nov 3 02:03:08 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
CVS Tags: comdex-fall-1999-base, comdex-fall-1999
Changes since 1.85: +19 -9 lines
Diff to previous 1.85 (colored) to selected 1.126.2.5 (colored)

hookup(): when using getservbyname() (when getaddrinfo() isn't available), if
the provided port is a valid number use that rather than trying to do
getservbyname() against it.
fixes a problem on foreign systems noted by Chuck Silvers <chuq@chuq.com>

Revision 1.85 / (download) - annotate - [select for diffs], Sun Oct 24 12:31:40 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.84: +63 -47 lines
Diff to previous 1.84 (colored) to selected 1.126.2.5 (colored)

new features:
- add `usage'; displays the usage of a command.
  implemented by calling the c_handler() with argc = 0, argv = "funcname".
- add `passive auto'; does the same as $FTPMODE=auto.
- add `set [option value]'; display all options, or set an option to a value.
- add `unset option'; unset an option.
- add getoptionvalue() to retrieve an option's value, and replace a few
  global variables with calls to this.
- implement cleanuppeer(), which resets various bits of state back to
  `disconnected'. call in disconnect() and lostpeer().
- support completing on `options'.
- improve recovery after a SIGINT may have closed the connection.
  XXX: there's still a couple to fix

other stuff:
- various consistency fixes in the man page.
- ensure that the command usage strings in the code and man page match reality.
- mput/mget: check that the connection still exists before each xfer.
- minor cosmetic changes in confirm().
- set code correctly in sizecmd() and modtime()
- don't need \n in err() strings.
- change lostpeer to take an argument (rather than casting (sig_t)lostpeer
  in signal handlers)
- knf and whitespace police.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Oct 12 06:05:01 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.83: +8 -5 lines
Diff to previous 1.83 (colored) to selected 1.126.2.5 (colored)

a few user interface and cosmetic tweaks:
* confirm(): move from util.c to cmds.c. display mnemonic string in its prompt.
  add support for `q' (terminate current xfer), `?' (show help list)
* in various signal handlers, output a linefeed only if fromatty.
* if fgets(stdin) returned NULL (i.e, EOF), clearerr(stdin) because you don't
  want future fgets to fail. this is not done for the fgets() in the main
  command loop, since ftp will quit at that point.
* unless ftp is invoked with -a, don't retain the anonftp setting between
  hosts (`ftp somehost:' sets anonftp, but you don't want that to `stick'
  if you close that connection and open a new one).

Revision 1.83 / (download) - annotate - [select for diffs], Sun Oct 10 22:33:55 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored) to selected 1.126.2.5 (colored)

use sigjmp_buf for sigsetjmp(), instead of jmp_buf.
noted by Havard.Eidnes@runit.sintef.no.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Oct 9 12:48:12 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.81: +36 -8 lines
Diff to previous 1.81 (colored) to selected 1.126.2.5 (colored)

allow a second SIGINT during the "xfer aborted. waiting for remote to finish abort."
stage. if this occurs, just call lostpeer() to close the connection.  whilst this
might be considered brutal, it's also extremely handy if you're impatient or there's
lossage at the remote end.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Oct 9 03:00:56 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.80: +48 -43 lines
Diff to previous 1.80 (colored) to selected 1.126.2.5 (colored)

* use sigsetjmp()/siglongjump() instead of setjmp()/longjmp(); the latter
  don't save the signal mask on some foreign systems.
* ensure signal handlers don't use stdio and do reset errno if they
  don't exit with siglongjmp()
* use a common SIGINT handler for {send,recv}request()

Revision 1.80 / (download) - annotate - [select for diffs], Tue Oct 5 22:04:30 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.79: +28 -15 lines
Diff to previous 1.79 (colored) to selected 1.126.2.5 (colored)

* set SIGQUIT to psummary in each of the xfer routines. (editline seems to
  override SIGQUIT when EL_SIGNAL = 1 (but we want the latter for all the
  other signal support it has).
* more fixes after previous rototill

Revision 1.79 / (download) - annotate - [select for diffs], Tue Oct 5 13:44:39 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.78: +21 -4 lines
Diff to previous 1.78 (colored) to selected 1.126.2.5 (colored)

the prior change was a bit too aggressive in factoring out common code in
{send,recv}request(). completion and uploading now works again...

Revision 1.78 / (download) - annotate - [select for diffs], Tue Oct 5 13:05:41 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.77: +61 -170 lines
Diff to previous 1.77 (colored) to selected 1.126.2.5 (colored)

* factor out SIGINFO setting into a handler that is always active (but only
  prints out info if bytes > 0). only set the handler if SIGINFO is defined
* hijack SIGQUIT to be the same as SIGINFO (foreign ports have this, and it's
  annoying to have SIGQUIT dump core on netbsd when it prints info on other
  systems)
* in {recv,send}request(), factor a lot of duplicated code out into a
  `cleanup' section at the end
* rework shell() a bit

Revision 1.77 / (download) - annotate - [select for diffs], Tue Oct 5 01:16:13 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.76: +38 -2 lines
Diff to previous 1.76 (colored) to selected 1.126.2.5 (colored)

add TNFi copyright to all files i've done more than a minor amount of work to...

Revision 1.76 / (download) - annotate - [select for diffs], Tue Oct 5 00:54:07 1999 UTC (24 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.75: +67 -19 lines
Diff to previous 1.75 (colored) to selected 1.126.2.5 (colored)

enhancments from Marc Horowitz <marc@mit.edu> to improve connection timeouts:
* implement xsignal_restart(), which only sets the SA_RESTART flag if
  specifically requested
* xsignal() is now a wrapper to xsignal_restart(). INFO, USR1, USR2 and WINCH
  are restartable, ALRM, INT, PIPE and QUIT are not.
* improve getreply()'s timeout code to take advantage of the above.

other changes:
* improve wording of how globbing works for `classic' URLs (host:path).
  suggested by John Refling <johnr@imageworks.com> in relation to PRs
  [bin/8519] and [bin/8520]
* always compile in the `edit' command even if NO_EDITCOMPLETE defined.
  it's just a no-op in the latter case, which is more consistent to
  the users.
* always compile in about: support (i.e, remove NO_ABOUT).
  i'm entitled to some vanity in this program...
* clean up some whitespace

Revision 1.75 / (download) - annotate - [select for diffs], Fri Oct 1 09:23:32 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.74: +2 -3 lines
Diff to previous 1.74 (colored) to selected 1.126.2.5 (colored)

restart_point is a global; no need for it here

Revision 1.74 / (download) - annotate - [select for diffs], Fri Oct 1 08:01:12 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.73: +20 -6 lines
Diff to previous 1.73 (colored) to selected 1.126.2.5 (colored)

If EPSV or EPRT fails, disable epsv4 for the rest of the current connection.
the disabled state can be overridden by toggling epsv4.

(I got sick of the errors about EPSV not being supported on almost
every server I connect to. This way we retain support for epsv4, but
it's not so whiny after the first failure...)

Revision 1.73 / (download) - annotate - [select for diffs], Fri Oct 1 06:55:44 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.72: +3 -7 lines
Diff to previous 1.72 (colored) to selected 1.126.2.5 (colored)

prefix the global variables in ftp_var.h with GLOBAL, which defaults
to "extern" if it's not set. define GLOBAL to (empty) in main.c.
this effectively moves all the globals into main.c whilst retaining
namespace access to them in other source files.
(global vars in header files confuse foreign linkers)

Revision 1.72 / (download) - annotate - [select for diffs], Thu Sep 30 23:51:27 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.71: +20 -20 lines
Diff to previous 1.71 (colored) to selected 1.126.2.5 (colored)

* In the !NI_NUMERICHOST case (i.e, getaddrinfo() challenged systems), portnum
  should be in host order. found/fixed by Matthias Pfaller <leo@dachau.marco.de>
* parse_url(): improve checking of portnum, and add an extra argument to pass
  back the parsed portnum to the caller (reduces a bit of code duplication)
* Move the KAME/WIDE copyrights after the BSD/TNFi ones. Since there was
  significantly less code added under the former, it's only fair on the latter.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Sep 30 06:35:13 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored) to selected 1.126.2.5 (colored)

in empty(), FD_ZERO(&rmask) not (&cin). (hi christos! :)
fixes abort_remote() when __USE_SELECT is defined.
thanks to simonb@netbsd.org for reporting this bug

Revision 1.70 / (download) - annotate - [select for diffs], Wed Sep 29 00:44:01 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.69: +2 -4 lines
Diff to previous 1.69 (colored) to selected 1.126.2.5 (colored)

* consistentnly use memset(a,0,c); there were some cases of memset(a,'\0',c)
* remove explicit extern int h_errno; it's in <netdb.h>
* add <termios.h> back to util.c; it contains struct winsize on some systems

Revision 1.69 / (download) - annotate - [select for diffs], Tue Sep 28 07:51:06 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.68: +2 -6 lines
Diff to previous 1.68 (colored) to selected 1.126.2.5 (colored)

remove debugging cruft

Revision 1.68 / (download) - annotate - [select for diffs], Tue Sep 28 06:47:41 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.67: +22 -29 lines
Diff to previous 1.67 (colored) to selected 1.126.2.5 (colored)

* add new commands:
	lpage	page local files
	pdir	as dir, but through your $PAGER
	pls	as ls, but through your $PAGER
* implement docase() (a la dotrans() et al) and use appropriately, rototilling
  some duplicated code
* globulize(): modify to return a pointer to the strdup()ed result in all cases,
  and hack the code that calls it to take this into account
* replace strcpy() and strncpy() with strlcpy()
* put(), getit(): use some aptly named local vars instead of argv[...]
* delint

Revision 1.67 / (download) - annotate - [select for diffs], Mon Sep 27 23:09:44 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.66: +52 -53 lines
Diff to previous 1.66 (colored) to selected 1.126.2.5 (colored)

* idle(): rename to idlecmd(). certain linux distributions have an incompatible
  prototype for idle() in <unistd.h> (which i thought was against namespace
  and sensibility guidelines, but...)
* consistently use xsignal() instead of signal(). we get known behaviour
  in all cases (SA_RESTART), which is good for some borken foreign systems.
* remove signal.h from most files; it's unnecessary now
* fetch_url(): use `long chunksize' instead of ssize_t; it's more portable, and
  we're setting chunksize with strtol() anyway
* xsignal(): only use SA_RESTART if it exists. SunOS 4.x doesn't have it
  but has the inverse (SA_INTERRUPT). the original function i was inspired
  from had this support (lib/signal.c, W. Richard Stevens' `UNP 2nd ed Vol 1').
* remove <termios.h> from util.c; it should be unnecessary now

Revision 1.66 / (download) - annotate - [select for diffs], Fri Sep 24 14:28:14 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.65: +6 -6 lines
Diff to previous 1.65 (colored) to selected 1.126.2.5 (colored)

* use %lld instead of %qd to print out (long long) vars.
  (slightly more portable; e.g, solaris supports this)
* remove some fluff (lint)

Revision 1.65 / (download) - annotate - [select for diffs], Fri Sep 24 06:57:37 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored) to selected 1.126.2.5 (colored)

fix a couple of thinkos in my recent work:
* abort_remote(): replace borken MIN(4,BUFSIZ) with just BUFSIZ; it
  should have been MAX(4,BUFSIZ), but it's probably safe to assume that
  BUFSIZ is at least 3... (fix from simonb)
* auth_url(): use the correct variable when calculating a buffer size.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Sep 22 07:18:34 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.63: +27 -18 lines
Diff to previous 1.63 (colored) to selected 1.126.2.5 (colored)

* add support for `xferbuf', which sets both `sndbuf' and `rcvbuf'
* document the above three commands
* rototill the way the sndbuf and rcvbuf work. remove resetsockbufsize()
* use the appropriate socket buffer size as the size of the buffer that
  the read()/write() loops use. speeds up things in some cases.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Sep 22 03:01:54 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.62: +6 -4 lines
Diff to previous 1.62 (colored) to selected 1.126.2.5 (colored)

replace snprintf() with strlcpy(), strlcat(), or direct assignment
where appropriate. (strlc*() are easier to port to foriegn systems).

XXX; there's still a few snprintf's in the progress meter stuff to convert

Revision 1.62 / (download) - annotate - [select for diffs], Tue Sep 21 13:17:22 1999 UTC (24 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.61: +21 -5 lines
Diff to previous 1.61 (colored) to selected 1.126.2.5 (colored)

* protect more of the AF_INET6 stuff with #ifdef INET6 (for portability)
* in the main data moving loops only call the initial gettimeofday() if
  rate throttling is enabled (saves a system call per loop when not
  throttling).

Revision 1.61 / (download) - annotate - [select for diffs], Tue Sep 14 22:49:14 1999 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored) to selected 1.126.2.5 (colored)

warn()->warnx() in a couple of places.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Sep 3 04:29:57 1999 UTC (24 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.59: +10 -10 lines
Diff to previous 1.59 (colored) to selected 1.126.2.5 (colored)

sync with recent kAME.
- avoid s6_addr{8,16,32} which are nonstanard.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Sep 1 05:03:42 1999 UTC (24 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.58: +7 -2 lines
Diff to previous 1.58 (colored) to selected 1.126.2.5 (colored)

ftpd(8): Copy sin6_scope_id from control connection to active data
connection destination, hoping this to help ftpd's behavior with
scoped IPv6 addresses.
I'm not sure if it is the right way, but it is the best way available to us.
LPRT or EPRT command gives no information about which interface (or scope)
to be used for new data connection.

ftp(1): On data connection establishment, warn if scoped address is used.
If peer (ftp daemon) does not handle scoped address, data connection
may not work right.

This seems to be sort of protocol spec hole, not implementation issue.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Aug 29 22:21:57 1999 UTC (24 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.57: +87 -6 lines
Diff to previous 1.57 (colored) to selected 1.126.2.5 (colored)

make ftp work again with the traditional gethostbyname/getservbyname
interfaces.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jul 20 17:52:03 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.56: +17 -17 lines
Diff to previous 1.56 (colored) to selected 1.126.2.5 (colored)

cleanup EPSV return code checking part.
remove debug fputs() left by mistake.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jul 17 22:39:18 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.55: +7 -7 lines
Diff to previous 1.55 (colored) to selected 1.126.2.5 (colored)

avoid false warnings on 22x reply code checks.  previous code was too picky.

From: Wolfgang Rupprecht <wolfgang@wsrcc.com>

Revision 1.55 / (download) - annotate - [select for diffs], Tue Jul 13 21:43:31 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.54: +81 -13 lines
Diff to previous 1.54 (colored) to selected 1.126.2.5 (colored)

implement more fallback case for EPSV.  BSDI ftpd is very broken
that it returns status 228 against EPSV, where it must return status
of 229.

separate PASV and LPSV processing.

PR: 7976

Revision 1.54 / (download) - annotate - [select for diffs], Sun Jul 11 20:37:39 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.53: +11 -4 lines
Diff to previous 1.53 (colored) to selected 1.126.2.5 (colored)

add epsv4 command, which enable/disable the use of EPSV/EPRT.

this is mainly for (hypothetical) ftp server which disconnect clients
that use EPSV/EPRT.  I've never seen any ftp server like this, but
epsv4 command may be of use when such an ftp server is found.

Revision 1.53 / (download) - annotate - [select for diffs], Sun Jul 11 00:41:59 1999 UTC (24 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored) to selected 1.126.2.5 (colored)

oops, need to declare tos.

Revision 1.52 / (download) - annotate - [select for diffs], Sat Jul 10 20:46:42 1999 UTC (24 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.51: +11 -2 lines
Diff to previous 1.51 (colored) to selected 1.126.2.5 (colored)

Kludge around non 4.4BSD systems that don't have a length field in struct
sockaddr*.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Jul 10 19:41:01 1999 UTC (24 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored) to selected 1.126.2.5 (colored)

remove unused variable

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jul 3 05:49:57 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.49: +3 -2 lines
Diff to previous 1.49 (colored) to selected 1.126.2.5 (colored)

free dynamically allocated storage on error.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jul 3 05:44:11 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.48: +45 -30 lines
Diff to previous 1.48 (colored) to selected 1.126.2.5 (colored)

clearify socket/connect loop.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Jul 2 08:07:41 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.47: +289 -104 lines
Diff to previous 1.47 (colored) to selected 1.126.2.5 (colored)

add dual-stack (IPv4/v6) support.  hope I broke no other part...

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jul 2 05:41:45 1999 UTC (24 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.46: +4 -4 lines
Diff to previous 1.46 (colored) to selected 1.126.2.5 (colored)

make a pointers static again (that were made automatic as part of the
xfer rate stuff, but i never completed the changes that didn't need it
set).
fixes a coredump noticed on current-users@ by Chan Yiu Wah <c5666305@hkstar.com>

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jun 29 10:43:18 1999 UTC (24 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.45: +82 -26 lines
Diff to previous 1.45 (colored) to selected 1.126.2.5 (colored)

[fear this; more ftp hacking from lukem :-]

features:
---------
* transfer rate throttling with the new `rate' command. syntax:
	rate direction [max [incr]]
  where direction is `all', `get' or `put'.
  if max is not supplied, the current settings are displayed.
  if max is supplied, then transfers in the given direction will
  be throttled to this value.
  if incr is supplied, the increment for the `on-the-fly' scaling
  will be set to that, otherwise `1024' is used.
  currently implemented for binary get, binary put, and url fetches.
  not yet supported for ascii get or put, or local file copies.
* on-the-fly scaling of the throttle based on signals:
    - SIGUSR1 raises the throttle rate by the increment for that direction
    - SIGUSR2 lowers the throttle rate by the increment for that direction
* -T dir,max[,incr] option to set rate from the command line
* `k', `m', `g' suffix support for bytecounts in the `hash', `rate',
  `rcvbuf' and `sndbuf' commands)

bug fixes and code mods:
------------------------
* fix up ftp_login() so that ruserpass() is always called, even for
  command-line url fetches.
* implement strsuftoi(), which parses a given number into a int with
  suffix support. replaces getsockbufsize()
* implement parserate(), which does the argv parsing for -T and rate
* save and restore errno in signal handlers (may not be necessary, but
  it doesn't hurt)

notes:
------
the rate command has had reasonable testing, but I'd like feedback
if it doesn't do the right thing, especially from people on slower
(i.e, modem) links.
I haven't tested the rate throttle against a http server which does
`transfer-encoding: chunked' because I couldn't find a server to
test against.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jun 24 14:50:56 1999 UTC (24 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.44: +66 -23 lines
Diff to previous 1.44 (colored) to selected 1.126.2.5 (colored)

rework empty() to work with both select and poll and abstract it better.

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 21:02:42 1999 UTC (24 years, 9 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Changes since 1.41: +10 -11 lines
Diff to previous 1.41 (colored) next main 1.42 (colored) to selected 1.126.2.5 (colored)

pullup 1.41->1.44 (lukem)

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jun 2 02:03:58 1999 UTC (24 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored) to selected 1.126.2.5 (colored)

* fix gate mode to login as `user@realhost' rather than using PASSERVE;
  the latter only seemed to work for TIS Gauntlet and not TIS fwtk.
  thanks to simonb@netbsd.org for testing this. fixes [bin/5556].
* if EOF (e.g, ^D) is entered at a username/password/account prompt which
  happens to use fgets(), exit the login rather than treating EOF as CR.
* don't use the comma operator where separate statements are valid
* always use snprintf to copy stuff into malloced buffers, just in case
  typos creep in and mean that the buffer ends up being overflowed

Revision 1.43 / (download) - annotate - [select for diffs], Tue May 4 14:12:37 1999 UTC (24 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.42: +8 -9 lines
Diff to previous 1.42 (colored) to selected 1.126.2.5 (colored)

print the "xxx bare linefeeds" message after the progressmeter. noted by dan@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Apr 28 13:35:40 1999 UTC (24 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored) to selected 1.126.2.5 (colored)

* make parsing of ftp:// urls more RFC 1738 compliant;
    - the path is split on `/', and each directory is CWD-ed into separately.
      (from [standards/7484] by Alan Barrett <apb@iafrica.com>)
    - support a trailing `;type=X' suffix, where X is a,i, or d.  (d isn't
      implemented, but it is recognised)
    - the only non-compliant behaviour is that empty directories sections
      (e.g `//') aren't run as `CWD ' - as a lot of ftpds don't like that.
      Instead, treat this as a no-op.
* don't support globbing for ftp urls, since that's technically not
  RFC compliant.
* fix a couple of man-page nits

Revision 1.41 / (download) - annotate - [select for diffs], Fri Feb 19 16:29:27 1999 UTC (25 years, 1 month ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE
Branch point for: netbsd-1-4
Changes since 1.40: +16 -4 lines
Diff to previous 1.40 (colored) to selected 1.126.2.5 (colored)

support restart during proxy transfers (the traditional ftp command, not the
http proxy). seems to work with my limited testing (i'm not a big user of
proxy).  bug noted by Jorgen Lundman <lundman@argonaut.com> in [bin/5948]

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 24 02:39:30 1999 UTC (25 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.39: +2 -12 lines
Diff to previous 1.39 (colored) to selected 1.126.2.5 (colored)

* -v enables verbose & progress, -V disables both
* set setvbuf(ttyout, NULL, _IOLBF, 0) and remove a bunch of fflush(ttyout).
* use fwrite() instead of write() for progressmeter (don't intermix stdio
  with non stdio ops)

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jan 5 23:33:44 1999 UTC (25 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.38: +9 -2 lines
Diff to previous 1.38 (colored) to selected 1.126.2.5 (colored)

Fall back from passive to active if connect() fails.  (from openbsd)

Revision 1.29.2.2 / (download) - annotate - [select for diffs], Tue Nov 10 18:48:58 1998 UTC (25 years, 4 months ago) by cgd
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003
Changes since 1.29.2.1: +140 -113 lines
Diff to previous 1.29.2.1 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored) to selected 1.126.2.5 (colored)

pull up rev(s) 1.31-1.38 from trunk.  (feyrer)

Revision 1.38 / (download) - annotate - [select for diffs], Sat Aug 8 06:46:02 1998 UTC (25 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.37: +25 -25 lines
Diff to previous 1.37 (colored) to selected 1.126.2.5 (colored)

* implement xsignal(); same semantics as signal() but uses sigaction
  with an explicit SA_RESTART. (needed for portability)
* use xsignal() for SIGALRM and SIGINFO handlers

Revision 1.37 / (download) - annotate - [select for diffs], Mon Aug 3 01:49:25 1998 UTC (25 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.36: +3 -8 lines
Diff to previous 1.36 (colored) to selected 1.126.2.5 (colored)

features:
* support $no_proxy, which is a comma or space separated list of
  host[:port] elements for which proxying is to be disabled.
  (asked for by cgd in [bin/5027])
* if $FTPANONPASS is defined, use that as the anon ftp password
  (instead of "`whoami`@")
* allow http URL's without a filename as long as an output file
  is specified.

other stuff:
* implement parse_url(), which breaks up a URL into its bits, and use.
* simplify url_get() and auto_fetch() to use parse_url() and to not
  modify the supplied URL or a copy of it.
* implement xmalloc() and xstrdup(); error-checked malloc()/strdup()
* add more consistency to messages, quoting strings in output as `%s'

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jul 10 04:39:04 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.35: +5 -5 lines
Diff to previous 1.35 (colored) to selected 1.126.2.5 (colored)

Add "sndbuf" and "rcvbuf" commands for setting the socket buffer sizes,
which in turn can allow the use of larger TCP windows.  This is a work in
progress; there is not yet support for specifying global defaults or
user prefrences on a host/network basis.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Jun 4 08:28:36 1998 UTC (25 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.34: +90 -68 lines
Diff to previous 1.34 (colored) to selected 1.126.2.5 (colored)

some fixes & enhancements from openbsd's ftp, with extra fixes by me:
* default to passive with active fallback. $FTPMODE modifies this behaviour.
  -A forces active connection.
* support '-o outfile' for auto-fetched files. outfile can be a file,
  `-' (for stdout), or '|command' (to output each file through command).
* support '-r waittime', which retries the connection after waittime seconds
  if it fails.
* fix 'page file' when restart is non-zero.
* try all ip-addresses of a host in a http fetch (as the normal ftp fetch
  does).

XXX: a ``broken pipe'' error sometimes occurs with -o '|command';
i haven't tracked this down yet.

Revision 1.34 / (download) - annotate - [select for diffs], Wed May 20 09:43:41 1998 UTC (25 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored) to selected 1.126.2.5 (colored)

Restore `preserve' value when we no longer need the modified version.

Revision 1.33 / (download) - annotate - [select for diffs], Wed May 20 00:54:52 1998 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.32: +12 -2 lines
Diff to previous 1.32 (colored) to selected 1.126.2.5 (colored)

- add <signal.h> since we are using signals.
- add <sys/time.h> since we are using utimes
- don't require quad_t to exist to compile.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Apr 1 21:07:03 1998 UTC (26 years ago) by kleink
Branch: MAIN
Changes since 1.31: +3 -2 lines
Diff to previous 1.31 (colored) to selected 1.126.2.5 (colored)

Need <time.h> for asctime() and localtime() prototypes.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jan 18 14:23:36 1998 UTC (26 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.30: +13 -14 lines
Diff to previous 1.30 (colored) to selected 1.126.2.5 (colored)

* ensure buffer for username is initialised, so ^D on username prompt
  doesn't use garbage for the username.  from "Soren S. Jorvang" <soren@t.dk>
  in [bin/4559]
* use in_port_t for ports, and USHRT_MAX instead of 0xffff
  (from millert@openbsd.org)
* use `NULL' instead of `(.... *)0' where appropriate.

Revision 1.29.2.1 / (download) - annotate - [select for diffs], Tue Nov 18 01:01:04 1997 UTC (26 years, 4 months ago) by mellon
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-RELEASE, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Changes since 1.29: +24 -32 lines
Diff to previous 1.29 (colored) to selected 1.126.2.5 (colored)

Pull rev 1.30 up from trunk (lukem)

Revision 1.30 / (download) - annotate - [select for diffs], Sat Nov 1 14:36:58 1997 UTC (26 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.29: +24 -32 lines
Diff to previous 1.29 (colored) to selected 1.126.2.5 (colored)

* in recvrequest(), ignore restart_point unless "RETR"ieving. fixes problems
  where a remote completion or `mget' would confuse the client a `restart'
  had been issued beforehand. now, `restart' is remembered until an operation
  that can actually use it is invoked.
* in sendrequest(), don't reset restart_point upon entry. fixes `restart'
  for `put' operations.
* if `restart' is invoked with no arguments, print current setting instead
  of displaying a usage
* consistently use printf("%qd", (long long)restart_point) when displaying
  restart_point
* use strto[lq]() instead of atol() when parsing `mark' and `restart' values
* remove unnecessary strlen()s when result of previous snprintf() will do
* replace a few malloc()/strcpy()s with strdup()s
* use SECSPERHOUR instead of '3600'

Revision 1.29 / (download) - annotate - [select for diffs], Sun Oct 19 19:09:05 1997 UTC (26 years, 5 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-3-base
Branch point for: netbsd-1-3
Changes since 1.28: +4 -5 lines
Diff to previous 1.28 (colored) to selected 1.126.2.5 (colored)

Use S_IS*(), not S_IF*.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Sep 13 09:05:56 1997 UTC (26 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.27: +7 -7 lines
Diff to previous 1.27 (colored) to selected 1.126.2.5 (colored)

Fixes from Todd Miller <Todd.Miller@courtesan.com>:
* use size_t instead of int in places
* use symbolic constants when using access()

Revision 1.27 / (download) - annotate - [select for diffs], Mon Aug 18 10:20:23 1997 UTC (26 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.26: +8 -8 lines
Diff to previous 1.26 (colored) to selected 1.126.2.5 (colored)

bugs fixed:
* don't interpret '-' or '|' when a local filename is determined from
  the remote name (i.e, in mget, and in get with only one argument).
  This is implemented using an extra argument to recvrequest().
  Fixes a major security hole.
* clean up memory leak when using globulize()
* clean up a couple of comments
* fix wording in TNF copyright

features added:
* support for TIS fwtk gate-ftp servers:
	* read defaults from $FTPSERVER && $FTPSERVERPORT
	* start in gate-ftp mode if invoked as 'gate-ftp'
	* toggle or set with 'gate [host [port]]'

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 20 09:45:53 1997 UTC (26 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.25: +44 -9 lines
Diff to previous 1.25 (colored) to selected 1.126.2.5 (colored)

* use RCSID() && COPYRIGHT() macros
* cleanup for WARNS=1 (including some ugly '(void)&var' bits wrapped in
  #ifdef __GNUC__ to shut up gcc warnings WRT setjmp/longjmp)
* use strtol() instead of atoi(), and more extensively check result of
  conversion
* use u_int16_t instead of short or int for TCP port addresses

Revision 1.25 / (download) - annotate - [select for diffs], Mon Apr 14 09:09:22 1997 UTC (26 years, 11 months ago) by lukem
Branch: MAIN
Changes since 1.24: +2 -99 lines
Diff to previous 1.24 (colored) to selected 1.126.2.5 (colored)

More enhancements/bugfixes (when will it end?)
* differentiate between being connected, and being logged in
* cleanup some text messages
* support username & password ftp URLs (ftp://user:pass@host/) in non-proxy
  situations; assume proxy supports it for proxy situations.
* cd to / before performing any autofetch transfers
* use strncasecmp in URL parsing. fix from <Todd.Miller@courtesan.com>

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 16 14:24:19 1997 UTC (27 years ago) by lukem
Branch: MAIN
Changes since 1.23: +16 -3 lines
Diff to previous 1.23 (colored) to selected 1.126.2.5 (colored)

Fixes from <Todd.Miller@cs.colorado.edu>, with some cleanup and reworks by me:
* only echo "Passive mode" in verbose mode; scripts that use ftp
  may get unwanted output otherwise
* disable progress bar and modification time preservation when
  retreiving to a non-regular files. fixes progress bar getting in
  way of "get file /dev/tty"
* setup el_init() et al if editing is set, not if fromatty.
  TODO: migrate this to a function, and call if editing is turned on later
	in the session. also implement edit_cleanup if editing is turned off
* call el_set() after setting SIGWINCH handler. This fixes the problem
  when suspending in a non-cbreak shell (e.g, csh) would trash your tty mode.
* reset interactive mode correctly in auto_fetch() mget mode

Revision 1.23 / (download) - annotate - [select for diffs], Thu Mar 13 06:23:17 1997 UTC (27 years ago) by lukem
Branch: MAIN
Changes since 1.22: +264 -213 lines
Diff to previous 1.22 (colored) to selected 1.126.2.5 (colored)

Features:
* support remglobbing of auto_fetch arguments
* new flag - '-e'; disable editing
* "page file" == "get file |${PAGER-less}"

Bugfixes/cleanup:
* consistently use a trailing '.' on messages
* code cleanup, including buffer overrun fixes, use puts
  and putchar in places, etc (inspired by OpenBSD mods)
* disable progress bar when local-file is a pipe or '-'
* skip \r in http headers
* fix remote ftpd slash bug more elegantly (so it works with ////)
* abort_remote(): check if cout==NULL before using it. should fix [bin/3273]
* fixed up cosmetic problems when complete_remote() generated errors from the
  remote server (such as "no files found", "login with user and pass", ...)
  done by adding extra argument to remglob(), which is a pointer to an error
  buffer to put messages in rather than printing to stdout.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Feb 1 10:45:03 1997 UTC (27 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.21: +17 -20 lines
Diff to previous 1.21 (colored) to selected 1.126.2.5 (colored)

[Yet Another Huge Ftp Commit - hopefully the last for a while,
 barring any more little things people want added ...]

New features:
* progressmeter is now asynchronous, so "stalled" transfers can be
  detected. "- stalled -" is displayed instead of the ETA in this case.
  When the xfer resumes, the time that the xfer was stalled for is
  factored out of the ETA. It is debatable whether this is better than
  not factoring it out, but I like it this way (I.e, if it stalls for 8
  seconds and the ETA was 30 seconds, when it resumes the ETA will still
  be 30 seconds).
* verbosity can be disabled on the command line (-V), so that in auto-fetch
  mode the only lines displayed will be a description of the file, and
  the progress bar (if possible)
* if the screen is resized (and detected via the SIGWINCH signal), the
  progress bar will rescale automatically.

Bugs fixed:
* progress bar will not use the last character on the line, as this can
  cause problems on some terminals
* screen dimensions (via ioctl(TIOCWINSZ)) should use stdout not stdin
* progressmeter() used some vars before initialising them
* ^D will quit now. [fixes bin/3162]
* use hstrerror() to generate error message for host name lookup failure.
* use getcwd instead of getwd (it should have been OK, but why tempt fate?)
* auto-fetch transfers will always return a positive exit value upon failure
  or interruption, relative to the file's position in argv[].
* remote completion of / will work, without putting a leading "///".
  This is actually a bug in ftpd(1), where "NLST /" prefixes all names
  with "//", but fixing every ftpd(1) is not an option...

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jan 19 14:19:13 1997 UTC (27 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.20: +6 -131 lines
Diff to previous 1.20 (colored) to selected 1.126.2.5 (colored)

New features:
* Command line editing via editline(3) library.
* Context sensitive command and file completion, including remote files.

Enhancements to auto-fetch feature:
* Support for http:// URLs using the http protocol, including proxy HTTP
  support via $htty_proxy if it's defined.
* The connection is kept open between successive files on the same host.
  (obviously, this does not count for http requests.)
* Return value of ftp is 0 on no error, or the offset in argv[] of the file
  which failed (i.e., argv[x] failed, ftp returns x).
* If the path in an ftp URL or classic format line has a trailing '/',
  cd to the path and enter interactive mode. Fixes [bin/3011], albiet
  requiring the user to help ftp in determining the operation.

Other changes:
* '-P port' works for normal ftp, and is the default for all classic style
  auto-fetch transfers and for ftp URLs that don't specify the port.
  (previously it would just work for the first xfer.)
* Some code moved into separated files along logical divisions.
* Editing and completion can be compiled out with -DSMALLFTP.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jan 9 20:19:38 1997 UTC (27 years, 2 months ago) by tls
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.126.2.5 (colored)

RCS ID police

Revision 1.19 / (download) - annotate - [select for diffs], Sun Dec 29 04:05:31 1996 UTC (27 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.18: +13 -12 lines
Diff to previous 1.18 (colored) to selected 1.126.2.5 (colored)

* preserve modtime if size is 0 [bin/3040, Enami Tsugutomo]
* in autofetch mode, don't retry a file if the connection failed - skip it
  and move to the next file. [bin/3051, Matt Green]
* only print error messages from SIZE or MDTM if the user used 'size' or
  'modt' (respectively). prevents extraneous warnings during normal transfers
  when connected to a site which doesn't support these (behaviour prior to
  last commit), but still allows error feedback to specific user requests
  for this info (which the last commit broke).
* 'account': only accept one optional argument
* if invoked as pftp, default to passive mode on (from FreeBSD)
* remove leading '0 ' in progress bar - looked ugly
* use warn instead of perror
* use strncpy when src isn't known to have safe length
* remglob(): use mkstemp() to prevent symlink games, and don't override
  _PATH_TMP, use it as the prefix to the temp file

Revision 1.18 / (download) - annotate - [select for diffs], Wed Dec 25 16:02:06 1996 UTC (27 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.17: +11 -5 lines
Diff to previous 1.17 (colored) to selected 1.126.2.5 (colored)

- make sure that the reply string is null-terminated, and copy only up to
  the initialized copy of the source string, since the source string is not
  null terminated at this point.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Dec 6 04:33:45 1996 UTC (27 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.16: +7 -6 lines
Diff to previous 1.16 (colored) to selected 1.126.2.5 (colored)

'b' == bits not bytes. for all prefixes >= 'K', explicitly specify 'B'
afterwards. don't print anything for a pure byte count. rework ETA display
as well.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Dec 6 02:06:50 1996 UTC (27 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.15: +175 -66 lines
Diff to previous 1.15 (colored) to selected 1.126.2.5 (colored)

functionality mods:
* implement 'progress bar/meter' (inspired by ncftp). use 'progress' to
  toggle on. it will display current file size to 5 digits, automatically
  determining suffix (up to 16384 P (petabytes) == 2^64).
* 'ls' now uses NLST (unadorned listing), a la older ftp clients. 'dir'
  still does LIST (long listing). idea from John Nemeth <jnemeth@cue.bc.ca>

bug fixes:
* return first line of reply in reply_string[] from getreply(), instead
  of last line. This fixes [bin/741] (parsing of SYST), and also means
  that SIZE and MDTM messages will be parsed correctly if they're longer
  than 1 line.
* parse URL-style auto-ftps that have no filename correctly
  (e.g, ftp://host, ftp://host/, ftp://host/dir/). pointed out by
  Jaromir Dolecek <dolecek@saruman.ics.muni.cz>
* pass the correct size array in 2nd arg of utimes() when setting the
  modification time

Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 28 03:12:37 1996 UTC (27 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.14: +53 -31 lines
Diff to previous 1.14 (colored) to selected 1.126.2.5 (colored)

More features, some of which were inspired by changes that
friedman@gnu.ai.mit.edu (Noah Friedman) made to his modified ftp:
- implement "lpwd" - local pwd
- implement "preserve" - toggle preserving of file modification
  times on retrieved files
- allow for explicit "on" or "off" arg to toggle commands
- "exit" synonym for "quit", "msend" synonym for "mput"
- in confirmation mode, allow 'a' (yes to rest of current command),
  and 'p' (turn off prompt mode, as if 'prompt off' was done,
  effective immediately)
- "modtime" returns time formatted as localtime, not GMT

Bug fixes:
- check for extraneous args on commands
- cleanup const usage, line formatting
- create 0 length temporary file in remglob() to prevent symlink games
  (from OpenBSD)
- check length of filename of ~/.netrc (from OpenBSD)

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 25 05:13:23 1996 UTC (27 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.13: +121 -39 lines
Diff to previous 1.13 (colored) to selected 1.126.2.5 (colored)

cleanups/bugfixes:
- don't echo 'ACCT' parameter when debugging (a la 'PASS')
- Fix checking of directory access for "/foo", the parent
  directory is "/", not "" (from FreeBSD)
- remove trailing whitespace on lines
- add any missing NetBSD tags
- cleanups to man page, includinging sorting options description

feature additions:
- variable sized hash marks (from [bin/683], but done in the hash command
  as an optional arg)
- more user-friendly transfer time printing (from FreeBSD, with mods)
- '-p' command line option to jump into PASV mode (closes [bin/2857],
  but with an option rather than checking argv[0])
- SIGINFO support for printing xfer stats when sending/receiving requests
- '-P port' for changing the port to connect to (from thorpej@netbsd.org)
- '-a': bypass normal login, and try anonymous login (from OpenBSD
  via thorpej)
- autofetch files via url (ftp://...) or "classic" (host:/file)
  (from OpenBSD via thorpej)
- 'ftp' synonymous with 'open' (from FreeBSD)

Revision 1.13 / (download) - annotate - [select for diffs], Sat Sep 16 22:32:59 1995 UTC (28 years, 6 months ago) by pk
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.126.2.5 (colored)

Correct timersub() argument order (from Thomas Eberhardt; PR#1470).

Revision 1.12 / (download) - annotate - [select for diffs], Fri Sep 8 01:06:28 1995 UTC (28 years, 6 months ago) by tls
Branch: MAIN
Changes since 1.11: +18 -11 lines
Diff to previous 1.11 (colored) to selected 1.126.2.5 (colored)

Sync with 4.4lite2

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Tue Sep 5 01:20:12 1995 UTC (28 years, 6 months ago) by tls
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.1: +198 -135 lines
Diff to previous 1.1.1.1 (colored) to selected 1.126.2.5 (colored)

imported from 44lite2

Revision 1.11 / (download) - annotate - [select for diffs], Sun May 21 16:49:33 1995 UTC (28 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +3 -5 lines
Diff to previous 1.10 (colored) to selected 1.126.2.5 (colored)

Use inet_aton(), not inet_addr().

Revision 1.10 / (download) - annotate - [select for diffs], Tue Mar 21 14:16:23 1995 UTC (29 years ago) by mycroft
Branch: MAIN
Changes since 1.9: +2 -26 lines
Diff to previous 1.9 (colored) to selected 1.126.2.5 (colored)

Update to use timer{add,sub}().

Revision 1.9.2.2 / (download) - annotate - [select for diffs], Mon Aug 29 03:09:16 1994 UTC (29 years, 7 months ago) by mycroft
Branch: netbsd-1-0
Changes since 1.9.2.1: +1531 -0 lines
Diff to previous 1.9.2.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored) to selected 1.126.2.5 (colored)

Add RCS ids.

Revision 1.9.2.1, Mon Aug 29 03:09:15 1994 UTC (29 years, 7 months ago) by mycroft
Branch: netbsd-1-0
Changes since 1.9: +0 -1531 lines
FILE REMOVED

file ftp.c was added on branch netbsd-1-0 on 1994-08-29 03:09:16 +0000

Revision 1.9 / (download) - annotate - [select for diffs], Mon Aug 29 03:09:15 1994 UTC (29 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0
Branch point for: netbsd-1-0
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored) to selected 1.126.2.5 (colored)

Add RCS ids.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Aug 25 04:27:49 1994 UTC (29 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.7: +59 -0 lines
Diff to previous 1.7 (colored) to selected 1.126.2.5 (colored)

passive mode support, from David Carrel <carrel@cisco.com>, and cleaned
up for the new ftp sources by me.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Aug 25 03:49:48 1994 UTC (29 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (colored) to selected 1.126.2.5 (colored)

the previous local changes

Revision 1.6 / (download) - annotate - [select for diffs], Thu Aug 25 03:48:02 1994 UTC (29 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.5: +134 -133 lines
Diff to previous 1.5 (colored) to selected 1.126.2.5 (colored)

clean up import, no local changes.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Thu Aug 25 03:27:51 1994 UTC (29 years, 7 months ago) by cgd
CVS Tags: lite-1
Changes since 1.1: +131 -128 lines
Diff to previous 1.1 (colored) next main 1.2 (colored) to selected 1.126.2.5 (colored)

import from 4.4-Lite

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 28 07:11:18 1994 UTC (30 years ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored) to selected 1.126.2.5 (colored)

kill typo

Revision 1.4 / (download) - annotate - [select for diffs], Sun Mar 27 10:05:27 1994 UTC (30 years ago) by cgd
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored) to selected 1.126.2.5 (colored)

off_t foo

Revision 1.3 / (download) - annotate - [select for diffs], Thu Sep 23 23:15:42 1993 UTC (30 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.2: +5 -4 lines
Diff to previous 1.2 (colored) to selected 1.126.2.5 (colored)

Display bytes/second rather than kbytes/sec, and use 3 digits of
precision for transfer time.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:15:28 1993 UTC (30 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored) to selected 1.126.2.5 (colored)

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.126.2.5 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN
Diff to selected 1.126.2.5 (colored)

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>